diff options
author | Brian Tarricone <brian@tarricone.org> | 2008-10-18 12:40:12 +0000 |
---|---|---|
committer | Brian Tarricone <brian@tarricone.org> | 2008-10-18 12:40:12 +0000 |
commit | 8a0e2f069d3e43f59e9bbed8acf014a7c8a15f3d (patch) | |
tree | 01db6f8ef2b93a63e57f97e16eebfdd2c88c74dd /libxfsm | |
parent | 56e41c907a8d1f98a29d98940d2a82b38902d0c1 (diff) | |
download | xfce4-session-8a0e2f069d3e43f59e9bbed8acf014a7c8a15f3d.tar.gz |
* configure.in.in: Depend on newer version of libxfconf.
* engines/*/Makefile.am: Link with libxfconf.
* libxfsm/xfsm-splash-rc.*: Replace XfceRc usage with
XfconfChannel.
* libxfsm/xfce4-session-2.0.pc.in: Add libxfconf-0 to required
packages list.
* settings/{module.*,splash-settings.c]: Load XfconfChannel
with a property base instead of the old XfceRc file.
* xfce4-session/xfsm-splash-screen.c: Fetch settings from
xfconf instead of rc file.
(Old svn revision: 28292)
Diffstat (limited to 'libxfsm')
-rw-r--r-- | libxfsm/xfce4-session-2.0.pc.in | 2 | ||||
-rw-r--r-- | libxfsm/xfsm-splash-rc.c | 52 | ||||
-rw-r--r-- | libxfsm/xfsm-splash-rc.h | 7 |
3 files changed, 32 insertions, 29 deletions
diff --git a/libxfsm/xfce4-session-2.0.pc.in b/libxfsm/xfce4-session-2.0.pc.in index b0c546b6..1748fe43 100644 --- a/libxfsm/xfce4-session-2.0.pc.in +++ b/libxfsm/xfce4-session-2.0.pc.in @@ -5,7 +5,7 @@ includedir=@includedir@ Name: xfce4-session Description: Xfce 4 session manager -Requires: libxfcegui4-1.0 +Requires: libxfcegui4-1.0 libxfconf-0 Version: @VERSION@ Libs: -L${libdir} -lxfsm-4.6 Cflags: -I${includedir}/xfce4/xfce4-session-4.6 diff --git a/libxfsm/xfsm-splash-rc.c b/libxfsm/xfsm-splash-rc.c index 8215a895..4931f186 100644 --- a/libxfsm/xfsm-splash-rc.c +++ b/libxfsm/xfsm-splash-rc.c @@ -25,35 +25,37 @@ #include <libxfsm/xfsm-splash-rc.h> +#define PROP_FROM_KEY(varname, key) \ + gchar varname[4096]; \ + g_strlcpy(varname, "/", sizeof(varname)); \ + g_strlcat(varname, key, sizeof(varname)) + struct _XfsmSplashRc { - gchar *group; - XfceRc *rc; + XfconfChannel *channel; }; XfsmSplashRc* -xfsm_splash_rc_new (XfceRc *rc, - const gchar *group) +xfsm_splash_rc_new (XfconfChannel *channel) { XfsmSplashRc *splash_rc; - splash_rc = g_new (XfsmSplashRc, 1); - splash_rc->group = g_strdup (group); - splash_rc->rc = rc; + splash_rc = g_new (XfsmSplashRc, 1); + splash_rc->channel = g_object_ref (channel); return splash_rc; } -const gchar* +gchar* xfsm_splash_rc_read_entry (XfsmSplashRc *splash_rc, const gchar *key, const gchar *fallback) { - xfce_rc_set_group (splash_rc->rc, splash_rc->group); - return xfce_rc_read_entry (splash_rc->rc, key, fallback); + PROP_FROM_KEY(prop, key); + return xfconf_channel_get_string (splash_rc->channel, prop, fallback); } @@ -62,8 +64,8 @@ xfsm_splash_rc_read_int_entry (XfsmSplashRc *splash_rc, const gchar *key, gint fallback) { - xfce_rc_set_group (splash_rc->rc, splash_rc->group); - return xfce_rc_read_int_entry (splash_rc->rc, key, fallback); + PROP_FROM_KEY(prop, key); + return xfconf_channel_get_int (splash_rc->channel, prop, fallback); } @@ -72,8 +74,8 @@ xfsm_splash_rc_read_bool_entry (XfsmSplashRc *splash_rc, const gchar *key, gboolean fallback) { - xfce_rc_set_group (splash_rc->rc, splash_rc->group); - return xfce_rc_read_bool_entry (splash_rc->rc, key, fallback); + PROP_FROM_KEY(prop, key); + return xfconf_channel_get_bool (splash_rc->channel, prop, fallback); } @@ -82,8 +84,8 @@ xfsm_splash_rc_read_list_entry (XfsmSplashRc *splash_rc, const gchar *key, const gchar *delimiter) { - xfce_rc_set_group (splash_rc->rc, splash_rc->group); - return xfce_rc_read_list_entry (splash_rc->rc, key, delimiter); + PROP_FROM_KEY(prop, key); + return xfconf_channel_get_string_list (splash_rc->channel, prop); } @@ -92,8 +94,8 @@ xfsm_splash_rc_write_entry (XfsmSplashRc *splash_rc, const gchar *key, const gchar *value) { - xfce_rc_set_group (splash_rc->rc, splash_rc->group); - xfce_rc_write_entry (splash_rc->rc, key, value); + PROP_FROM_KEY(prop, key); + xfconf_channel_set_string (splash_rc->channel, prop, value); } @@ -102,8 +104,8 @@ xfsm_splash_rc_write_int_entry (XfsmSplashRc *splash_rc, const gchar *key, gint value) { - xfce_rc_set_group (splash_rc->rc, splash_rc->group); - xfce_rc_write_int_entry (splash_rc->rc, key, value); + PROP_FROM_KEY(prop, key); + xfconf_channel_set_int (splash_rc->channel, prop, value); } @@ -112,8 +114,8 @@ xfsm_splash_rc_write_bool_entry (XfsmSplashRc *splash_rc, const gchar *key, gboolean value) { - xfce_rc_set_group (splash_rc->rc, splash_rc->group); - xfce_rc_write_bool_entry (splash_rc->rc, key, value); + PROP_FROM_KEY(prop, key); + xfconf_channel_set_bool (splash_rc->channel, prop, value); } @@ -123,15 +125,15 @@ xfsm_splash_rc_write_list_entry (XfsmSplashRc *splash_rc, gchar **value, const gchar *delimiter) { - xfce_rc_set_group (splash_rc->rc, splash_rc->group); - xfce_rc_write_list_entry (splash_rc->rc, key, value, delimiter); + PROP_FROM_KEY(prop, key); + xfconf_channel_set_string_list (splash_rc->channel, prop, (gchar const **)value); } void xfsm_splash_rc_free (XfsmSplashRc *splash_rc) { - g_free (splash_rc->group); + g_object_unref (splash_rc->channel); g_free (splash_rc); } diff --git a/libxfsm/xfsm-splash-rc.h b/libxfsm/xfsm-splash-rc.h index 4da0cf79..aea7d3ea 100644 --- a/libxfsm/xfsm-splash-rc.h +++ b/libxfsm/xfsm-splash-rc.h @@ -23,6 +23,7 @@ #define __XFSM_SPLASH_RC_H__ #include <gmodule.h> +#include <xfconf/xfconf.h> #include <libxfce4util/libxfce4util.h> @@ -32,10 +33,10 @@ typedef struct _XfsmSplashRc XfsmSplashRc; G_MODULE_IMPORT -XfsmSplashRc *xfsm_splash_rc_new (XfceRc *rc, - const gchar *group); +XfsmSplashRc *xfsm_splash_rc_new (XfconfChannel*channel); + G_MODULE_IMPORT -const gchar *xfsm_splash_rc_read_entry (XfsmSplashRc *splash_rc, +gchar *xfsm_splash_rc_read_entry (XfsmSplashRc *splash_rc, const gchar *key, const gchar *fallback); G_MODULE_IMPORT |