After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 531169 - A mechanism for setting defaults
A mechanism for setting defaults
Status: RESOLVED FIXED
Product: GConf
Classification: Deprecated
Component: gconf
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GConf Maintainers
GConf Maintainers
Depends on:
Blocks: 536531
 
 
Reported: 2008-05-03 03:05 UTC by Matthias Clasen
Modified: 2009-01-17 21:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (37.12 KB, patch)
2008-05-03 03:12 UTC, Matthias Clasen
none Details | Review
updated patch (49.50 KB, patch)
2008-06-04 01:46 UTC, Matthias Clasen
none Details | Review
the patch that was committed (8.98 KB, patch)
2008-07-11 16:37 UTC, Matthias Clasen
committed Details | Review

Description Matthias Clasen 2008-05-03 03:05:41 UTC
We are looking at a way to use the existing gnome capplets to set system-wide defaults. One use-case for this is to set the gconf keys that influence the login screen with gdm 2.22, e.g the /desktop/gnome/background/picture_filename for the background image.

What I am proposing here is a dbus service that takes a list of GConf keys and copies the values from the callers GConf database to the system-wide database.
This is a privileged operation and access to it is controlled via PolicyKit.
The service is not running all the time, it gets activated via system bus activation.

Additionally, the service can also set and unset mandatory values.
Comment 1 Matthias Clasen 2008-05-03 03:12:23 UTC
Created attachment 110305 [details] [review]
patch
Comment 2 Matthias Clasen 2008-06-04 01:46:39 UTC
Created attachment 112097 [details] [review]
updated patch

Here is a new patch that completes the previous one by making notice if defaults change underneath it. This is implemented by having the defaults-mechanism emit a signal on the session bus, that is then caught by the gconfds.
Comment 3 David Zeuthen (not reading bugmail) 2008-06-04 04:39:19 UTC
You want to use 

 s/description/_description/
 s/message/_message/

in defaults/org.gnome.gconf.defaults.policy.in file.. and also add this file to po/POTFILES.in to make sure i18n works.
Comment 4 Matthias Clasen 2008-07-11 16:34:51 UTC
2008-07-11  Matthias Clasen  <mclasen@redhat.com>

        Bug 531169 – A mechanism for setting defaults

        The cache-clearing part of this patch is thanks
        to Behdad Esfahbod.

        * defaults/*: A DBus system bus service that can copy a
        subtree of GConf values from the callers db to a system-wide
        db, using PolicyKit to control access.

        * configure.in: Add --enable-defaults-service to optionally
        build the defaults service.

        * gconf/gconf-database.[hc]: Add
        gconf_database_clear_cache_for_sources.

        * gconf/gconf-sources.[hc]: Add gconf_sources_clear_cache_for_sources.

        * gconf/gconfd.c: Listen for changes in the system-wide
        databases by the defaults service, and clear the cache.

        * po/POTFILES.in: Glue
        * Makefile.am: Glue

Comment 5 Matthias Clasen 2008-07-11 16:37:06 UTC
Created attachment 114405 [details] [review]
the patch that was committed