From 3aff43d07ae62961e995237770c820aefa78e5dd Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Wed, 27 Oct 2010 09:08:32 -0400 Subject: Bug 632169 - manual use of gsettings-data-convert Add some words and example code to the documentation about why you might want to manually invoke gsettings-data-convert and how you should go about doing that. (cherry picked from commit dfb0577ef4947afb32d91a72769bd22d6c1edfaa) --- docs/reference/gio/migrating-gconf.xml | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/docs/reference/gio/migrating-gconf.xml b/docs/reference/gio/migrating-gconf.xml index 1992fe657..44d455ba6 100644 --- a/docs/reference/gio/migrating-gconf.xml +++ b/docs/reference/gio/migrating-gconf.xml @@ -449,5 +449,69 @@ some-odd-key1 = /apps/myapp/some_ODD-key1 script if you are making use of the GConf backend or the conversion utility. + + + If, as an application developer, you are interested in manually + ensuring that gsettings-data-convert has been + invoked (for example, to deal with the case where the user is + logged in during a distribution upgrade or for non-XDG desktop + environments which do not run the command as an autostart) you + may invoke it manually during your program initialisation. This + is not recommended for all application authors -- it is your + choice if this use case concerns you enough. + + + Internally, gsettings-data-convert uses a + keyfile to track which settings have been migrated. The + following code fragment will check that keyfile to see if your + data conversion script has been run yet and, if not, will + attempt to invoke the tool to run it. You should adapt it to + your application as you see fit. + + + + + + + + Although there is the possibility that the + gsettings-data-convert script will end up + running multiple times concurrently with this approach, it is + believed that this is safe. + -- cgit v1.2.3