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.
This commit is contained in:
Bastien Nocera 2011-02-04 03:06:40 +00:00
parent b1af38f23d
commit 91faba68b2

View file

@ -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,
@ -2152,27 +2146,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)
{
@ -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);