[gnome-shell/gbsneto/icon-grid-dnd-fixes: 8/14] appDisplay: Only change excluded-apps when not deleting folder
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/icon-grid-dnd-fixes: 8/14] appDisplay: Only change excluded-apps when not deleting folder
- Date: Thu, 24 Sep 2020 23:28:11 +0000 (UTC)
commit cc0011a58d085b640e30844f657fe52fe04f6402
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Sep 24 12:41:27 2020 -0300
appDisplay: Only change excluded-apps when not deleting folder
It is useless to update the 'excluded-apps' list when we know we're going
to delete the folder entirely.
Only update 'excluded-apps' when not deleting the app folder.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
js/ui/appDisplay.js | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 88503e12d6..ce99e7ee39 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1803,15 +1803,6 @@ class FolderView extends BaseAppView {
if (index >= 0)
folderApps.splice(index, 1);
- // If this is a categories-based folder, also add it to
- // the list of excluded apps
- let categories = this._folder.get_strv('categories');
- if (categories.length > 0) {
- let excludedApps = this._folder.get_strv('excluded-apps');
- excludedApps.push(app.id);
- this._folder.set_strv('excluded-apps', excludedApps);
- }
-
// Remove the folder if this is the last app icon; otherwise,
// just remove the icon
if (folderApps.length == 0) {
@@ -1825,6 +1816,15 @@ class FolderView extends BaseAppView {
folders.splice(folders.indexOf(this._id), 1);
settings.set_strv('folder-children', folders);
} else {
+ // If this is a categories-based folder, also add it to
+ // the list of excluded apps
+ const categories = this._folder.get_strv('categories');
+ if (categories.length > 0) {
+ const excludedApps = this._folder.get_strv('excluded-apps');
+ excludedApps.push(app.id);
+ this._folder.set_strv('excluded-apps', excludedApps);
+ }
+
this._folder.set_strv('apps', folderApps);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]