After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 722333 - dateMenu: Try to use the default calendar application
dateMenu: Try to use the default calendar application
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-16 13:42 UTC by Florian Müllner
Modified: 2015-05-05 22:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dateMenu: Try to use the default calendar application (1.58 KB, patch)
2014-01-16 13:43 UTC, Florian Müllner
reviewed Details | Review
dateMenu: Try to use the default calendar application (1.67 KB, patch)
2014-08-08 17:29 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2014-01-16 13:42:59 UTC
See patch. I've seen some mention of this in Fedora before, but the last time I've seen this raised was for RHEL in https://bugzilla.redhat.com/show_bug.cgi?id=1052201.

(Also: I'm pretty sure we'd get away with using get_default_for_type() unconditionally iff the list returned by get_recommended_for_type() is not empty, but guarding against glib changes that would unlikely go unnoticed for a long time seems worth the additional check IMHO)
Comment 1 Florian Müllner 2014-01-16 13:43:03 UTC
Created attachment 266460 [details] [review]
dateMenu: Try to use the default calendar application

Commit 14ceb10555699 changed the "Open Calendar" item to open the
"recommended" calendar application rather than the default one to
avoid problems with MIME subclassing (namely falling back to the
default text editor when no calendar app is installed).
With this change however, the application launched does no longer
necessarily match the one configured in Settings, which is unexpected.
To avoid both problems, use the default calendar application again,
but only if it is in the list of recommended applications.
Comment 2 Giovanni Campagna 2014-01-17 16:49:38 UTC
Review of attachment 266460 [details] [review]:

::: js/ui/dateMenu.js
@@ +197,3 @@
+        if (apps && (apps.length > 0)) {
+            let app = Gio.AppInfo.get_default_for_type('text/calendar', false);
+            this._calendarApp = apps.indexOf(app) != -1 ? app : apps[0];

This will never succeed, because the GAppInfo objects are different. You need to compare the IDs, or go through ShellApp.
Comment 3 Florian Müllner 2014-08-08 17:29:36 UTC
Created attachment 282937 [details] [review]
dateMenu: Try to use the default calendar application
Comment 4 Giovanni Campagna 2014-08-19 15:23:49 UTC
Review of attachment 282937 [details] [review]:

Looks good.
Comment 5 Florian Müllner 2014-08-19 16:14:54 UTC
Attachment 282937 [details] pushed as 3e20843 - dateMenu: Try to use the default calendar application