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
This commit is contained in:
Florian Müllner 2020-03-14 14:45:42 +01:00
parent 4bfdd677e3
commit 66f9a9df81
2 changed files with 7 additions and 6 deletions

View File

@ -1251,8 +1251,8 @@ var AppSearchProvider = class AppSearchProvider {
let results = []; let results = [];
groups.forEach(group => { groups.forEach(group => {
group = group.filter(appID => { group = group.filter(appID => {
let app = Gio.DesktopAppInfo.new(appID); const app = this._appSys.lookup_app(appID);
return app && app.should_show(); return app && app.app_info.should_show();
}); });
results = results.concat(group.sort( results = results.concat(group.sort(
(a, b) => usage.compare(a, b) (a, b) => usage.compare(a, b)

View File

@ -837,7 +837,8 @@ class EventsSection extends MessageList.MessageListSection {
this._title.connect('clicked', this._onTitleClicked.bind(this)); this._title.connect('clicked', this._onTitleClicked.bind(this));
this._title.connect('key-focus-in', this._onKeyFocusIn.bind(this)); this._title.connect('key-focus-in', this._onKeyFocusIn.bind(this));
Shell.AppSystem.get_default().connect('installed-changed', this._appSys = Shell.AppSystem.get_default();
this._appSys.connect('installed-changed',
this._appInstalledChanged.bind(this)); this._appInstalledChanged.bind(this));
this._appInstalledChanged(); this._appInstalledChanged();
} }
@ -933,9 +934,9 @@ class EventsSection extends MessageList.MessageListSection {
let appInfo = this._getCalendarApp(); let appInfo = this._getCalendarApp();
if (appInfo.get_id() === 'org.gnome.Evolution.desktop') { 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) if (app)
appInfo = app; appInfo = app.app_info;
} }
appInfo.launch([], global.create_app_launch_context(0, -1)); appInfo.launch([], global.create_app_launch_context(0, -1));
} }