remoteSearch: Fetch enabled/disabled list once
GLib should be caching the values but it seems unnecessary to fetch and marshal what should be the same lists N times instead of just once Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1791>
This commit is contained in:
parent
4bfb91c5cd
commit
2f70e524c3
@ -142,16 +142,16 @@ function loadRemoteSearchProviders(searchSettings, callback) {
|
|||||||
// Special case gnome-control-center to be always active and always first
|
// Special case gnome-control-center to be always active and always first
|
||||||
sortOrder.unshift('gnome-control-center.desktop');
|
sortOrder.unshift('gnome-control-center.desktop');
|
||||||
|
|
||||||
|
const disabled = searchSettings.get_strv('disabled');
|
||||||
|
const enabled = searchSettings.get_strv('enabled');
|
||||||
|
|
||||||
loadedProviders = loadedProviders.filter(provider => {
|
loadedProviders = loadedProviders.filter(provider => {
|
||||||
let appId = provider.appInfo.get_id();
|
let appId = provider.appInfo.get_id();
|
||||||
|
|
||||||
if (provider.defaultEnabled) {
|
if (provider.defaultEnabled)
|
||||||
let disabled = searchSettings.get_strv('disabled');
|
|
||||||
return !disabled.includes(appId);
|
return !disabled.includes(appId);
|
||||||
} else {
|
else
|
||||||
let enabled = searchSettings.get_strv('enabled');
|
|
||||||
return enabled.includes(appId);
|
return enabled.includes(appId);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
loadedProviders.sort((providerA, providerB) => {
|
loadedProviders.sort((providerA, providerB) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user