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

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