[gnome-settings-daemon] daemon: Remove use of settings_prefix
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] daemon: Remove use of settings_prefix
- Date: Wed, 13 Oct 2010 12:48:11 +0000 (UTC)
commit bd47948b602d680ade2e463e8d5c01a3d244f501
Author: Bastien Nocera <hadess hadess net>
Date: Tue Oct 12 18:11:41 2010 +0100
daemon: Remove use of settings_prefix
And fix loading plugins information.
Spotted by Alban Browaeys <prahal yahoo com>
https://bugzilla.gnome.org/show_bug.cgi?id=631933
gnome-settings-daemon/gnome-settings-manager.c | 80 +-------------------
gnome-settings-daemon/gnome-settings-manager.h | 4 -
gnome-settings-daemon/gnome-settings-manager.xml | 3 -
gnome-settings-daemon/gnome-settings-plugin-info.c | 2 +-
gnome-settings-daemon/main.c | 10 +--
5 files changed, 4 insertions(+), 95 deletions(-)
---
diff --git a/gnome-settings-daemon/gnome-settings-manager.c b/gnome-settings-daemon/gnome-settings-manager.c
index 0869fc5..0288e09 100644
--- a/gnome-settings-daemon/gnome-settings-manager.c
+++ b/gnome-settings-daemon/gnome-settings-manager.c
@@ -50,16 +50,10 @@ struct GnomeSettingsManagerPrivate
{
DBusGConnection *connection;
GSettings *settings;
- char *settings_prefix;
GSList *plugins;
};
enum {
- PROP_0,
- PROP_SETTINGS_PREFIX,
-};
-
-enum {
PLUGIN_ACTIVATED,
PLUGIN_DEACTIVATED,
LAST_SIGNAL
@@ -185,7 +179,7 @@ _load_file (GnomeSettingsManager *manager,
G_CALLBACK (on_plugin_deactivated), manager);
key_name = g_strdup_printf ("%s.plugins.%s",
- manager->priv->settings_prefix,
+ DEFAULT_SETTINGS_PREFIX,
gnome_settings_plugin_info_get_location (info));
gnome_settings_plugin_info_set_settings_prefix (info, key_name);
g_free (key_name);
@@ -323,7 +317,7 @@ gnome_settings_manager_start (GnomeSettingsManager *manager,
}
gnome_settings_profile_start ("initializing plugins");
- manager->priv->settings = g_settings_new (manager->priv->settings_prefix);
+ manager->priv->settings = g_settings_new (DEFAULT_SETTINGS_PREFIX ".plugins");
_load_all (manager);
gnome_settings_profile_end ("initializing plugins");
@@ -335,16 +329,6 @@ gnome_settings_manager_start (GnomeSettingsManager *manager,
return ret;
}
-gboolean
-gnome_settings_manager_start_with_settings_prefix (GnomeSettingsManager *manager,
- const char *settings_prefix,
- GError **error)
-{
- g_object_set (manager, "settings-prefix", settings_prefix, NULL);
-
- return gnome_settings_manager_start (manager, error);
-}
-
void
gnome_settings_manager_stop (GnomeSettingsManager *manager)
{
@@ -365,54 +349,6 @@ gnome_settings_manager_stop (GnomeSettingsManager *manager)
manager->priv->settings = NULL;
}
-static void
-_set_settings_prefix (GnomeSettingsManager *self,
- const char *prefix)
-{
- g_free (self->priv->settings_prefix);
- self->priv->settings_prefix = g_strdup (prefix);
-}
-
-static void
-gnome_settings_manager_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GnomeSettingsManager *self;
-
- self = GNOME_SETTINGS_MANAGER (object);
-
- switch (prop_id) {
- case PROP_SETTINGS_PREFIX:
- _set_settings_prefix (self, g_value_get_string (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gnome_settings_manager_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GnomeSettingsManager *self;
-
- self = GNOME_SETTINGS_MANAGER (object);
-
- switch (prop_id) {
- case PROP_SETTINGS_PREFIX:
- g_value_set_string (value, self->priv->settings_prefix);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
static GObject *
gnome_settings_manager_constructor (GType type,
guint n_construct_properties,
@@ -447,8 +383,6 @@ gnome_settings_manager_class_init (GnomeSettingsManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->get_property = gnome_settings_manager_get_property;
- object_class->set_property = gnome_settings_manager_set_property;
object_class->constructor = gnome_settings_manager_constructor;
object_class->dispose = gnome_settings_manager_dispose;
object_class->finalize = gnome_settings_manager_finalize;
@@ -474,14 +408,6 @@ gnome_settings_manager_class_init (GnomeSettingsManagerClass *klass)
G_TYPE_NONE,
1, G_TYPE_STRING);
- g_object_class_install_property (object_class,
- PROP_SETTINGS_PREFIX,
- g_param_spec_string ("settings-prefix",
- "settings-prefix",
- "settings-prefix",
- DEFAULT_SETTINGS_PREFIX,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
g_type_class_add_private (klass, sizeof (GnomeSettingsManagerPrivate));
dbus_g_object_type_install_info (GNOME_TYPE_SETTINGS_MANAGER, &dbus_glib_gnome_settings_manager_object_info);
@@ -506,8 +432,6 @@ gnome_settings_manager_finalize (GObject *object)
g_return_if_fail (manager->priv != NULL);
- g_free (manager->priv->settings_prefix);
-
G_OBJECT_CLASS (gnome_settings_manager_parent_class)->finalize (object);
}
diff --git a/gnome-settings-daemon/gnome-settings-manager.h b/gnome-settings-daemon/gnome-settings-manager.h
index 1ccd4b5..39c1b0c 100644
--- a/gnome-settings-daemon/gnome-settings-manager.h
+++ b/gnome-settings-daemon/gnome-settings-manager.h
@@ -61,10 +61,6 @@ GQuark gnome_settings_manager_error_quark (void);
GType gnome_settings_manager_get_type (void);
GnomeSettingsManager * gnome_settings_manager_new (void);
-gboolean gnome_settings_manager_start_with_settings_prefix
- (GnomeSettingsManager *manager,
- const char *settings_prefix,
- GError **error);
gboolean gnome_settings_manager_start (GnomeSettingsManager *manager,
GError **error);
void gnome_settings_manager_stop (GnomeSettingsManager *manager);
diff --git a/gnome-settings-daemon/gnome-settings-manager.xml b/gnome-settings-daemon/gnome-settings-manager.xml
index 07a6762..9fcdf3e 100644
--- a/gnome-settings-daemon/gnome-settings-manager.xml
+++ b/gnome-settings-daemon/gnome-settings-manager.xml
@@ -4,9 +4,6 @@
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="gnome_settings_manager"/>
<method name="Awake"/>
<method name="Start"/>
- <method name="StartWithSettingsPrefix">
- <arg name="settings_prefix" direction="in" type="s"/>
- </method>
<signal name="PluginActivated">
<arg name="name" type="s"/>
</signal>
diff --git a/gnome-settings-daemon/gnome-settings-plugin-info.c b/gnome-settings-daemon/gnome-settings-plugin-info.c
index 823530e..6d397aa 100644
--- a/gnome-settings-daemon/gnome-settings-plugin-info.c
+++ b/gnome-settings-daemon/gnome-settings-plugin-info.c
@@ -310,7 +310,7 @@ plugin_enabled_cb (GSettings *settings,
if (g_strcmp0 (key, "active") == 0) {
if (g_settings_get_boolean (settings, "active"))
gnome_settings_plugin_info_activate (info);
- else
+ else
gnome_settings_plugin_info_deactivate (info);
}
}
diff --git a/gnome-settings-daemon/main.c b/gnome-settings-daemon/main.c
index 4761e4f..aa2952b 100644
--- a/gnome-settings-daemon/main.c
+++ b/gnome-settings-daemon/main.c
@@ -44,7 +44,6 @@
#define GNOME_SESSION_DBUS_OBJECT "/org/gnome/SessionManager"
#define GNOME_SESSION_DBUS_INTERFACE "org.gnome.SessionManager"
-static char *settings_prefix = NULL;
static gboolean no_daemon = FALSE;
static gboolean debug = FALSE;
static gboolean do_timed_exit = FALSE;
@@ -54,7 +53,6 @@ static int term_signal_pipe_fds[2];
static GOptionEntry entries[] = {
{"debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{"no-daemon", 0, 0, G_OPTION_ARG_NONE, &no_daemon, N_("Don't become a daemon"), NULL },
- {"settings-prefix", 0, 0, G_OPTION_ARG_STRING, &settings_prefix, N_("Settings prefix from which to load plugin settings"), NULL},
{ "timed-exit", 0, 0, G_OPTION_ARG_NONE, &do_timed_exit, N_("Exit after a time (for debugging)"), NULL },
{NULL}
};
@@ -481,11 +479,7 @@ main (int argc, char *argv[])
automatically. Otherwise, wait for an Awake etc. */
if (g_getenv ("DBUS_STARTER_BUS_TYPE") == NULL) {
error = NULL;
- if (settings_prefix != NULL) {
- res = gnome_settings_manager_start_with_settings_prefix (manager, settings_prefix, &error);
- } else {
- res = gnome_settings_manager_start (manager, &error);
- }
+ res = gnome_settings_manager_start (manager, &error);
if (! res) {
g_warning ("Unable to start: %s", error->message);
g_error_free (error);
@@ -502,8 +496,6 @@ main (int argc, char *argv[])
gtk_main ();
out:
- g_free (settings_prefix);
-
if (bus != NULL) {
dbus_g_connection_unref (bus);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]