Skip to content

Conversation

@matthiasclasen
Copy link
Collaborator

@matthiasclasen matthiasclasen commented Feb 2, 2019

We do a one-time conversion of existing dconf user settings into a keyfile in the apps XDG_CONFIG_DIR, where the glib keyfile settingsbackend will look for it.

Still to do: Only do this conversion when the app doesn't have dconf sandbox holes anymore, to prevent creating the file prematurely, while the app is still using dconf.

Closes #2648


g_debug ("Add defaults in dir %s", prefix);
add_dconf_dir_to_keyfile (defaults_data, client, prefix);
add_dconf_dir_to_keyfile (defaults_data, client, prefix, DCONF_READ_DEFAULT_VALUE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want/need to copy default values? Might as well just insert the minimum subset of user values that are changed?

@matthiasclasen
Copy link
Collaborator Author

matthiasclasen commented Feb 2, 2019

Actually, i misread. We want default values, since they may be changed by the sysadmin, or by something like fleet commander

@matthiasclasen
Copy link
Collaborator Author

from irc discussion: We should limit the value propagation to just the app id path, and not allow extra paths here.

@matthiasclasen
Copy link
Collaborator Author

Now we are only looking at the app id path. Unfortunately, my very first test case fails this test: gnome-todo uses org.gnome.Todo as app-id, and /org/gnome/todo/ as dconf path :(

@alexlarsson
Copy link
Member

Yeah, I wonder if we should be a bit more lenient with the exact format of the path. Say, allow the app to specify a path, which we weakly match to the app id? For example, don't have to match case, and maybe don't compare any '-' and '_'. Would need to do some research on current use.

@alexlarsson
Copy link
Member

So, i don't like the dconf check. And given the pathname mismatch issue maybe we can kill two birds with one stone by adding some kind of "x-dconf-migrate-path" metadata option. Only if/when this is set do we do a (one-time) migration of the user data. And we can allow this path to differ in insignificant ways.

@matthiasclasen
Copy link
Collaborator Author

Ok, redone with a migrate-path key.

Should we document the valid X-DConf keys somewhere ?

return FALSE;

if (path1[i] == path2[i])
continue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary, the tolower() case below handles it to.

@alexlarsson
Copy link
Member

Other than that this looks good to me. Needs some manual rebasing though.

Pass the DCONF_READ flags down, so we can use a different one.
We do a one-time conversion of existing dconf user settings
into a keyfile in the apps XDG_CONFIG_DIR, where the glib
keyfile settingsbackend will look for it.
@matthiasclasen
Copy link
Collaborator Author

@rh-atomic-bot r=alexlarsson

@rh-atomic-bot
Copy link

📌 Commit e158c5b has been approved by alexlarsson

@rh-atomic-bot
Copy link

⚡ Test exempted: merge already tested.

rh-atomic-bot pushed a commit that referenced this pull request Feb 21, 2019
We do a one-time conversion of existing dconf user settings
into a keyfile in the apps XDG_CONFIG_DIR, where the glib
keyfile settingsbackend will look for it.

Closes: #2678
Approved by: alexlarsson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants