[gnome-control-center] display: Remove support for old D-Bus interface



commit 91faba68b2b1c3058a555ecfa79b3cde623ca69d
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 4 03:06:40 2011 +0000

    display: Remove support for old D-Bus interface
    
    version 1 support for the protocol is gone. All the
    gnome-settings-daemon for the past 2 years have supported the new
    interface.

 panels/display/xrandr-capplet.c |   46 +++-----------------------------------
 1 files changed, 4 insertions(+), 42 deletions(-)
---
diff --git a/panels/display/xrandr-capplet.c b/panels/display/xrandr-capplet.c
index c873fd9..345bfe4 100644
--- a/panels/display/xrandr-capplet.c
+++ b/panels/display/xrandr-capplet.c
@@ -85,11 +85,6 @@ struct App
   DBusGConnection *connection;
   DBusGProxy *proxy;
   DBusGProxyCall *proxy_call;
-
-  enum {
-    APPLYING_VERSION_1,
-    APPLYING_VERSION_2
-  } apply_configuration_state;
 };
 
 static void rebuild_gui (App *app);
@@ -2138,7 +2133,6 @@ begin_version2_apply_configuration (App *app, GdkWindow *parent_window, guint32
                                           "org.gnome.SettingsDaemon.XRANDR_2");
   g_assert (app->proxy != NULL); /* that call does not fail unless we pass bogus names */
 
-  app->apply_configuration_state = APPLYING_VERSION_2;
   app->proxy_call = dbus_g_proxy_begin_call (app->proxy, "ApplyConfiguration",
                                              apply_configuration_returned_cb, app,
                                              NULL,
@@ -2153,27 +2147,6 @@ begin_version2_apply_configuration (App *app, GdkWindow *parent_window, guint32
 }
 
 static void
-begin_version1_apply_configuration (App *app)
-{
-  app->proxy = dbus_g_proxy_new_for_name (app->connection,
-                                          "org.gnome.SettingsDaemon",
-                                          "/org/gnome/SettingsDaemon/XRANDR",
-                                          "org.gnome.SettingsDaemon.XRANDR");
-  g_assert (app->proxy != NULL); /* that call does not fail unless we pass bogus names */
-
-  app->apply_configuration_state = APPLYING_VERSION_1;
-  app->proxy_call = dbus_g_proxy_begin_call (app->proxy, "ApplyConfiguration",
-                                             apply_configuration_returned_cb, app,
-                                             NULL,
-                                             G_TYPE_INVALID,
-                                             G_TYPE_INVALID);
-  /* FIXME: we don't check for app->proxy_call == NULL, which could happen if
-   * the connection was disconnected.  This is left as an exercise for the
-   * reader.
-   */
-}
-
-static void
 ensure_current_configuration_is_saved (void)
 {
   GnomeRRScreen *rr_screen;
@@ -2215,21 +2188,10 @@ apply_configuration_returned_cb (DBusGProxy       *proxy,
   success = dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID);
 
   if (!success) {
-    if (app->apply_configuration_state == APPLYING_VERSION_2
-        && g_error_matches (error, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD)) {
-      g_error_free (error);
-
-      g_object_unref (app->proxy);
-      app->proxy = NULL;
-
-      begin_version1_apply_configuration (app);
-      return;
-    } else {
-      /* We don't pop up an error message; gnome-settings-daemon already does that
-       * in case the selected RANDR configuration could not be applied.
-       */
-      g_error_free (error);
-    }
+    /* We don't pop up an error message; gnome-settings-daemon already does that
+     * in case the selected RANDR configuration could not be applied.
+     */
+    g_error_free (error);
   }
 
   g_object_unref (app->proxy);



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