appDisplay: Avoid double slash when creating default folders

Creating these default folders still doesn't work. After some
investigation I found that's because the template we use for
the path when creating the `child` `Gio.Settings` instance
results in a double slash - it comes out as e.g.
/org/gnome/desktop/app-folders//folders/Utilities/ . dconf does
not gracefully handle this as many other things that handle
paths do, it considers it a programmer error. It results in
error messages like:

dconf_changeset_set: assertion 'dconf_is_path (path, NULL)' failed

which is slightly confusing. Anyway, we fix it by removing a
slash from the template.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2242>
This commit is contained in:
Adam Williamson 2022-03-15 13:25:16 -07:00 committed by Marge Bot
parent 95f4a1ecd6
commit c5f6482705

View File

@ -1471,7 +1471,7 @@ class AppDisplay extends BaseAppView {
const { name, categories, apps } = DEFAULT_FOLDERS[folder];
const child = new Gio.Settings({
schema_id: 'org.gnome.desktop.app-folders.folder',
path: `${path}/folders/${folder}/`,
path: `${path}folders/${folder}/`,
});
child.set_string('name', name);
child.set_boolean('translate', true);