[gnome-shell] js: Always use AppSystem to lookup apps
- From: Florian MĂźllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] js: Always use AppSystem to lookup apps
- Date: Sat, 14 Mar 2020 19:43:38 +0000 (UTC)
commit 66f9a9df81f7fabb6f6ecdbd465efaf597c6f828
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 | 9 +++++----
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 461a48682c..62a99b9fe9 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1251,8 +1251,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 aa1c4558a5..5b2e947732 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -837,8 +837,9 @@ 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();
}
@@ -933,9 +934,9 @@ class EventsSection extends MessageList.MessageListSection {
let appInfo = this._getCalendarApp();
if (appInfo.get_id() === 'org.gnome.Evolution.desktop') {
- let app = Gio.DesktopAppInfo.new('evolution-calendar.desktop');
+ let app = this._appSys.lookup_app('evolution-calendar.desktop');
if (app)
- appInfo = app;
+ appInfo = app.app_info;
}
appInfo.launch([], global.create_app_launch_context(0, -1));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]