GNOME Bugzilla – Bug 722333
dateMenu: Try to use the default calendar application
Last modified: 2015-05-05 22:10:14 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)
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.
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.
Created attachment 282937 [details] [review] dateMenu: Try to use the default calendar application
Review of attachment 282937 [details] [review]: Looks good.
Attachment 282937 [details] pushed as 3e20843 - dateMenu: Try to use the default calendar application