[gnome-shell/wip/rstrode/login-screen-extensions: 121/134] js: Always use AppSystem to lookup apps




commit 995e8eb7b1cd8e0fc5e0e2c43c10432eea80fab8
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Mar 14 14:45:42 2020 +0100

    js: Always use AppSystem to lookup apps
    
    There is no good reason for bypassing the application cache in
    AppSystem and loading .desktop files again.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1093

 js/ui/appDisplay.js |  4 ++--
 js/ui/calendar.js   | 16 ++++++++++------
 2 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index a2d6910853..cb2be7d3c8 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1001,8 +1001,8 @@ var AppSearchProvider = class AppSearchProvider {
         let results = [];
         groups.forEach(group => {
             group = group.filter(appID => {
-                let app = Gio.DesktopAppInfo.new(appID);
-                return app && app.should_show();
+                const app = this._appSys.lookup_app(appID);
+                return app && app.app_info.should_show();
             });
             results = results.concat(group.sort(
                 (a, b) => usage.compare(a, b)
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index cd3e879c4e..3ae2e44f81 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -791,8 +791,9 @@ var EventsSection = class EventsSection extends MessageList.MessageListSection {
         this._title.connect('clicked', this._onTitleClicked.bind(this));
         this._title.connect('key-focus-in', this._onKeyFocusIn.bind(this));
 
-        Shell.AppSystem.get_default().connect('installed-changed',
-                                              this._appInstalledChanged.bind(this));
+        this._appSys = Shell.AppSystem.get_default();
+        this._appSys.connect('installed-changed',
+            this._appInstalledChanged.bind(this));
         this._appInstalledChanged();
     }
 
@@ -883,10 +884,13 @@ var EventsSection = class EventsSection extends MessageList.MessageListSection {
         Main.overview.hide();
         Main.panel.closeCalendar();
 
-        let app = this._getCalendarApp();
-        if (app.get_id() == 'evolution.desktop')
-            app = Gio.DesktopAppInfo.new('evolution-calendar.desktop');
-        app.launch([], global.create_app_launch_context(0, -1));
+        let appInfo = this._getCalendarApp();
+        if (app.get_id() == 'evolution.desktop') {
+            let app = this._appSys.lookup_app('evolution-calendar.desktop');
+            if (app)
+                appInfo = app.app_info;
+        }
+        appInfo.launch([], global.create_app_launch_context(0, -1));
     }
 
     setDate(date) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]