[gnome-settings-daemon/docking-stations] Remove gnome_settings_session_get_upower_client()



commit 7e238f2da29c383ba391fd8d133bbcf3e5348fe2
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Jan 10 17:59:16 2012 -0600

    Remove gnome_settings_session_get_upower_client()
    
    It was done to return a singleton from up_client_new(), but in fact
    up_client_new() already returns a singleton.
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 gnome-settings-daemon/gnome-settings-session.c |   14 --------------
 gnome-settings-daemon/gnome-settings-session.h |    5 -----
 plugins/power/gsd-power-manager.c              |    2 +-
 plugins/xrandr/gsd-xrandr-manager.c            |    2 +-
 4 files changed, 2 insertions(+), 21 deletions(-)
---
diff --git a/gnome-settings-daemon/gnome-settings-session.c b/gnome-settings-daemon/gnome-settings-session.c
index 47d36de..af4922f 100644
--- a/gnome-settings-daemon/gnome-settings-session.c
+++ b/gnome-settings-daemon/gnome-settings-session.c
@@ -307,17 +307,3 @@ gnome_settings_session_new (void)
 	session = g_object_new (GNOME_TYPE_SETTINGS_SESSION, NULL);
 	return GNOME_SETTINGS_SESSION (session);
 }
-
-UpClient *
-gnome_settings_session_get_upower_client (void)
-{
-	static UpClient *client;
-
-	if (client != NULL)
-		return g_object_ref (client);
-
-	client = up_client_new ();
-	g_object_add_weak_pointer (G_OBJECT (client), (gpointer *) &client);
-
-	return client;
-}
diff --git a/gnome-settings-daemon/gnome-settings-session.h b/gnome-settings-daemon/gnome-settings-session.h
index fb49d4c..c9b64ee 100644
--- a/gnome-settings-daemon/gnome-settings-session.h
+++ b/gnome-settings-daemon/gnome-settings-session.h
@@ -24,8 +24,6 @@
 
 #include <glib-object.h>
 
-#include <libupower-glib/upower.h>
-
 G_BEGIN_DECLS
 
 #define GNOME_TYPE_SETTINGS_SESSION		(gnome_settings_session_get_type ())
@@ -60,9 +58,6 @@ GType			 gnome_settings_session_state_get_type	(void);
 GnomeSettingsSession	*gnome_settings_session_new		(void);
 GnomeSettingsSessionState gnome_settings_session_get_state	(GnomeSettingsSession	*session);
 
-UpClient                *gnome_settings_session_get_upower_client (void);
-
-
 
 G_END_DECLS
 
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 30e9fe1..1909a95 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -3329,7 +3329,7 @@ gsd_power_manager_start (GsdPowerManager *manager,
         g_signal_connect (manager->priv->settings, "changed",
                           G_CALLBACK (engine_settings_key_changed_cb), manager);
         manager->priv->settings_screensaver = g_settings_new ("org.gnome.desktop.screensaver");
-        manager->priv->up_client = gnome_settings_session_get_upower_client ();
+        manager->priv->up_client = up_client_new ();
         g_signal_connect (manager->priv->up_client, "notify-sleep",
                           G_CALLBACK (upower_notify_sleep_cb), manager);
         g_signal_connect (manager->priv->up_client, "notify-resume",
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index a498e5b..06b0f88 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -1973,7 +1973,7 @@ gsd_xrandr_manager_start (GsdXrandrManager *manager,
 
         g_signal_connect (manager->priv->rw_screen, "changed", G_CALLBACK (on_randr_event), manager);
 
-        manager->priv->upower_client = gnome_settings_session_get_upower_client ();
+        manager->priv->upower_client = up_client_new ();
         manager->priv->laptop_lid_is_closed = up_client_get_lid_is_closed (manager->priv->upower_client);
         g_signal_connect (manager->priv->upower_client, "changed",
                           G_CALLBACK (power_client_changed_cb), manager);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]