[gnome-shell] dateMenu: Try to use the default calendar application
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dateMenu: Try to use the default calendar application
- Date: Tue, 19 Aug 2014 16:14:39 +0000 (UTC)
commit 3e20843d9cff9a5156a55f6202e9e3b1061f1f5e
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jan 16 07:41:46 2014 -0500
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 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index 335ab2d..1a86a6a 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;
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]