From 3e20843d9cff9a5156a55f6202e9e3b1061f1f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 16 Jan 2014 07:41:46 -0500 Subject: [PATCH] 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. https://bugzilla.gnome.org/show_bug.cgi?id=722333 --- js/ui/dateMenu.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 335ab2dbf..1a86a6ac2 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -211,10 +211,13 @@ const DateMenuButton = new Lang.Class({ return this._calendarApp; let apps = Gio.AppInfo.get_recommended_for_type('text/calendar'); - if (apps && (apps.length > 0)) - this._calendarApp = apps[0]; - else + if (apps && (apps.length > 0)) { + let app = Gio.AppInfo.get_default_for_type('text/calendar', false); + let defaultInRecommended = apps.some(function(a) { return a.equal(app); }); + this._calendarApp = defaultInRecommended ? app : apps[0]; + } else { this._calendarApp = null; + } return this._calendarApp; },