[gnome-shell/gnome-3-34] folderView: Reset schemas before removing the folder
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-34] folderView: Reset schemas before removing the folder
- Date: Thu, 21 Nov 2019 23:13:41 +0000 (UTC)
commit aa1d297bdfd72340ba938658d894e1b6b78705c7
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Nov 21 18:45:12 2019 -0300
folderView: Reset schemas before removing the folder
When removing the last icon of a folder, FolderView first removes
the folder from org.gnome.desktop.app-folders.folder-children, then
proceeds to reset all its keys, which removes the relocatable schema.
That order of operations turns out to be problematic. Removing the
folder from 'folder-children' destroys the folder icon, which in turn
destroys the folder view, which throws a load of warnings in the
journal.
Fix that by removing the folder after resetting the schema keys. In
fact, what we're doing here is not using 'this' anymore.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/841
js/ui/appDisplay.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index ae4af54ca7..a6b29a31eb 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1397,15 +1397,15 @@ var FolderView = class FolderView extends BaseAppView {
// Remove the folder if this is the last app icon; otherwise,
// just remove the icon
if (folderApps.length == 0) {
- let settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders' });
- let folders = settings.get_strv('folder-children');
- folders.splice(folders.indexOf(this._id), 1);
- settings.set_strv('folder-children', folders);
-
// Resetting all keys deletes the relocatable schema
let keys = this._folder.settings_schema.list_keys();
for (let key of keys)
this._folder.reset(key);
+
+ let settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders' });
+ let folders = settings.get_strv('folder-children');
+ folders.splice(folders.indexOf(this._id), 1);
+ settings.set_strv('folder-children', folders);
} else {
this._folder.set_strv('apps', folderApps);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]