← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~ted/indicator-session/gdm-proxy-remove into lp:indicator-session

 

Ted Gould has proposed merging lp:~ted/indicator-session/gdm-proxy-remove into lp:indicator-session with lp:~ted/indicator-session/screensaver-proxy-on-request as a prerequisite.

    Requested reviews:
    Indicator Applet Developers (indicator-applet-developers)


Removes a GDM proxy that we don't need anymore as we're not watching the autologin setting.
-- 
https://code.launchpad.net/~ted/indicator-session/gdm-proxy-remove/+merge/18855
Your team ayatana-commits is subscribed to branch lp:indicator-session.
=== modified file 'src/lock-helper.c'
--- src/lock-helper.c	2010-02-08 17:08:17 +0000
+++ src/lock-helper.c	2010-02-08 17:08:17 +0000
@@ -27,14 +27,8 @@
 static guint cookie = 0;
 static DBusGProxyCall * cookie_call = NULL;
 
-static DBusGProxy * gdm_settings_proxy = NULL;
-static gboolean gdm_auto_login = FALSE;
-static const gchar * gdm_auto_login_string = "daemon/AutomaticLoginEnable";
-
 static gboolean is_guest = FALSE;
 
-static gdm_autologin_cb_t gdm_autologin_cb = NULL;
-
 void build_gss_proxy (void);
 
 /* Checks to see if there is an error and reports
@@ -121,26 +115,11 @@
 	return;
 }
 
-/* Setting up a call back */
-void
-lock_screen_gdm_cb_set (gdm_autologin_cb_t cb)
-{
-	if (gdm_autologin_cb) {
-		g_warning("Already had a callback, setting up a new one...");
-	}
-
-	gdm_autologin_cb = cb;
-	return;
-}
-
 /* This is our logic on whether the screen should be locked
    or not.  It effects everything else. */
 gboolean
 will_lock_screen (void)
 {
-	if (gdm_auto_login) {
-		return FALSE;
-	}
 	if (is_guest) {
 		return FALSE;
 	}
@@ -148,95 +127,6 @@
 	return TRUE;
 }
 
-/* Respond to the signal of autologin changing to see if the
-   setting for timed login changes. */
-static void
-gdm_settings_change (DBusGProxy * proxy, const gchar * value, const gchar * old, const gchar * new, gpointer data)
-{
-	if (g_strcmp0(value, gdm_auto_login_string)) {
-		/* This is not a setting that we care about,
-		   there is only one. */
-		return;
-	}
-	g_debug("GDM Settings change: %s", new);
-
-	if (g_strcmp0(new, "true") == 0) {
-		gdm_auto_login = TRUE;
-	} else {
-		gdm_auto_login = FALSE;
-	}
-
-	if (gdm_autologin_cb != NULL) {
-		gdm_autologin_cb();
-	}
-
-	return;
-}
-
-/* Get back the data from querying to see if there is auto
-   login enabled in GDM */
-static void
-gdm_get_autologin (DBusGProxy * proxy, DBusGProxyCall * call, gpointer data)
-{
-	GError * error = NULL;
-	gchar * value = NULL;
-
-	if (!dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_STRING, &value, G_TYPE_INVALID)) {
-		g_warning("Unable to get autologin setting: %s", error != NULL ? error->message : "null");
-		g_error_free(error);
-		return;
-	}
-
-	g_return_if_fail(value != NULL);
-	gdm_settings_change(proxy, gdm_auto_login_string, NULL, value, NULL);
-
-	return;
-}
-
-/* Sets up the proxy and queries for the setting to know
-   whether we're doing an autologin. */
-static void
-build_gdm_proxy (void)
-{
-	g_return_if_fail(gdm_settings_proxy == NULL);
-
-	/* Grab the system bus */
-	DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
-	g_return_if_fail(bus != NULL);
-
-	/* Get the settings proxy */
-	gdm_settings_proxy = dbus_g_proxy_new_for_name_owner(bus,
-	                                                     "org.gnome.DisplayManager",
-	                                                     "/org/gnome/DisplayManager/Settings",
-	                                                     "org.gnome.DisplayManager.Settings", NULL);
-	g_return_if_fail(gdm_settings_proxy != NULL);
-
-	/* Signal for value changed */
-	dbus_g_proxy_add_signal(gdm_settings_proxy,
-	                        "ValueChanged",
-	                        G_TYPE_STRING,
-	                        G_TYPE_STRING,
-	                        G_TYPE_STRING,
-	                        G_TYPE_INVALID);
-	dbus_g_proxy_connect_signal(gdm_settings_proxy,
-	                            "ValueChanged",
-	                            G_CALLBACK(gdm_settings_change),
-	                            NULL,
-	                            NULL);
-
-	/* Start to get the initial value */
-	dbus_g_proxy_begin_call(gdm_settings_proxy,
-	                        "GetValue",
-	                        gdm_get_autologin,
-	                        NULL,
-	                        NULL,
-	                        G_TYPE_STRING,
-	                        gdm_auto_login_string,
-	                        G_TYPE_INVALID);
-
-	return;
-}
-
 /* When the screensave go active, if we've got a mainloop
    running we should quit it. */
 static void
@@ -328,8 +218,6 @@
 		is_guest = TRUE;
 	}
 
-	build_gdm_proxy();
-
 	return FALSE;
 }
 

=== modified file 'src/lock-helper.h'
--- src/lock-helper.h	2010-02-03 00:21:47 +0000
+++ src/lock-helper.h	2010-02-08 17:08:17 +0000
@@ -24,14 +24,11 @@
 
 #include <libdbusmenu-glib/menuitem.h>
 
-typedef void (*gdm_autologin_cb_t) (void);
-
 void screensaver_throttle (gchar * reason);
 void screensaver_unthrottle (void);
 
 gboolean will_lock_screen (void);
 void lock_screen (DbusmenuMenuitem * mi, guint timestamp, gpointer data);
 gboolean lock_screen_setup (gpointer data);
-void lock_screen_gdm_cb_set (gdm_autologin_cb_t cb);
 
 #endif /* LOCK_HELPER_H__ */

=== modified file 'src/session-service.c'
--- src/session-service.c	2010-02-05 00:58:28 +0000
+++ src/session-service.c	2010-02-08 17:08:17 +0000
@@ -264,20 +264,6 @@
 	return;
 }
 
-/* Respond to the signal of autologin changing to see if the
-   setting for timed login changes. */
-static void
-gdm_settings_change (void)
-{
-	if (!will_lock_screen()) {
-		dbusmenu_menuitem_property_set_bool(lock_menuitem, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
-	} else {
-		dbusmenu_menuitem_property_set_bool(lock_menuitem, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
-	}
-
-	return;
-}
-
 /* Checks to see if we should show the guest suession item */
 static gboolean
 check_guest_session (void)
@@ -574,7 +560,6 @@
 	                 G_CALLBACK(service_shutdown), NULL);
 
 	g_idle_add(lock_screen_setup, NULL);
-	lock_screen_gdm_cb_set(gdm_settings_change);
 
     root_menuitem = dbusmenu_menuitem_new();
 	g_debug("Root ID: %d", dbusmenu_menuitem_get_id(root_menuitem));


Follow ups