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

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