Blame SOURCES/0006-js-Always-use-AppSystem-to-lookup-apps.patch

547cbf
From be4a943a4974a9c37fabbfd4afd0f698b7d6f068 Mon Sep 17 00:00:00 2001
547cbf
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
547cbf
Date: Sat, 14 Mar 2020 14:45:42 +0100
547cbf
Subject: [PATCH 6/6] js: Always use AppSystem to lookup apps
547cbf
547cbf
There is no good reason for bypassing the application cache in
547cbf
AppSystem and loading .desktop files again.
547cbf
547cbf
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1093
547cbf
---
547cbf
 js/ui/appDisplay.js |  4 ++--
547cbf
 js/ui/calendar.js   | 16 ++++++++++------
547cbf
 2 files changed, 12 insertions(+), 8 deletions(-)
547cbf
547cbf
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
547cbf
index 3798fac57..76d05efc9 100644
547cbf
--- a/js/ui/appDisplay.js
547cbf
+++ b/js/ui/appDisplay.js
547cbf
@@ -1111,8 +1111,8 @@ var AppSearchProvider = new Lang.Class({
547cbf
         let results = [];
547cbf
         groups.forEach(group => {
547cbf
             group = group.filter(appID => {
547cbf
-                let app = Gio.DesktopAppInfo.new(appID);
547cbf
-                return app && app.should_show();
547cbf
+                const app = this._appSys.lookup_app(appID);
547cbf
+                return app && app.app_info.should_show();
547cbf
             });
547cbf
             results = results.concat(group.sort(
547cbf
                 (a, b) => usage.compare('', a, b)
547cbf
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
547cbf
index 651aac610..0b2c61bf5 100644
547cbf
--- a/js/ui/calendar.js
547cbf
+++ b/js/ui/calendar.js
547cbf
@@ -834,8 +834,9 @@ var EventsSection = new Lang.Class({
547cbf
         this._title.connect('clicked', this._onTitleClicked.bind(this));
547cbf
         this._title.connect('key-focus-in', this._onKeyFocusIn.bind(this));
547cbf
 
547cbf
-        Shell.AppSystem.get_default().connect('installed-changed',
547cbf
-                                              this._appInstalledChanged.bind(this));
547cbf
+        this._appSys = Shell.AppSystem.get_default();
547cbf
+        this._appSys.connect('installed-changed',
547cbf
+            this._appInstalledChanged.bind(this));
547cbf
         this._appInstalledChanged();
547cbf
     },
547cbf
 
547cbf
@@ -933,10 +934,13 @@ var EventsSection = new Lang.Class({
547cbf
         Main.overview.hide();
547cbf
         Main.panel.closeCalendar();
547cbf
 
547cbf
-        let app = this._getCalendarApp();
547cbf
-        if (app.get_id() == 'evolution.desktop')
547cbf
-            app = Gio.DesktopAppInfo.new('evolution-calendar.desktop');
547cbf
-        app.launch([], global.create_app_launch_context(0, -1));
547cbf
+        let appInfo = this._getCalendarApp();
547cbf
+        if (app.get_id() == 'evolution.desktop') {
547cbf
+            let app = this._appSys.lookup_app('evolution-calendar.desktop');
547cbf
+            if (app)
547cbf
+                appInfo = app.app_info;
547cbf
+        }
547cbf
+        appInfo.launch([], global.create_app_launch_context(0, -1));
547cbf
     },
547cbf
 
547cbf
     setDate(date) {
547cbf
-- 
547cbf
2.26.0
547cbf