[evince] [shell] Fix for GDBus API changes



commit f8b878d7815b4e07f44c8f308741dd8db6108767
Author: Christian Persch <chpe gnome org>
Date:   Mon May 10 18:06:41 2010 +0200

    [shell] Fix for GDBus API changes

 cut-n-paste/totem-screensaver/totem-scrsaver.c |   86 ++++++++++++------------
 shell/ev-application.c                         |   12 ++--
 shell/ev-media-player-keys.c                   |   36 +++++-----
 3 files changed, 67 insertions(+), 67 deletions(-)
---
diff --git a/cut-n-paste/totem-screensaver/totem-scrsaver.c b/cut-n-paste/totem-screensaver/totem-scrsaver.c
index 2e3b362..30ea718 100644
--- a/cut-n-paste/totem-screensaver/totem-scrsaver.c
+++ b/cut-n-paste/totem-screensaver/totem-scrsaver.c
@@ -103,32 +103,32 @@ screensaver_inhibit_dbus (TotemScrsaver *scr,
                 return;
 
 	if (inhibit) {
-                value = g_dbus_connection_invoke_method_sync (scr->priv->connection,
-                                                              GS_SERVICE,
-                                                              GS_PATH,
-                                                              GS_INTERFACE,
-                                                              "Inhibit",
-                                                              g_variant_new ("(ss)",
-                                                                             "Evince",
-                                                                             _("Running in presentation mode")),
-                                                              G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
-                                                              -1,
-                                                              NULL,
-                                                              &error);
+                value = g_dbus_connection_call_sync (scr->priv->connection,
+                                                     GS_SERVICE,
+                                                     GS_PATH,
+                                                     GS_INTERFACE,
+                                                     "Inhibit",
+                                                     g_variant_new ("(ss)",
+                                                                    "Evince",
+                                                                    _("Running in presentation mode")),
+                                                     G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
+                                                     -1,
+                                                     NULL,
+                                                     &error);
 		if (error && g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD)) {
 			/* try the old API */
                         g_clear_error (&error);
-                        value = g_dbus_connection_invoke_method_sync (scr->priv->connection,
-                                                                      GS_SERVICE,
-                                                                      GS_PATH,
-                                                                      GS_INTERFACE,
-                                                                      "InhibitActivation",
-                                                                      g_variant_new ("(s)",
-                                                                                     _("Running in presentation mode")),
-                                                                      G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
-                                                                      -1,
-                                                                      NULL,
-                                                                      &error);
+                        value = g_dbus_connection_call_sync (scr->priv->connection,
+                                                             GS_SERVICE,
+                                                             GS_PATH,
+                                                             GS_INTERFACE,
+                                                             "InhibitActivation",
+                                                             g_variant_new ("(s)",
+                                                                            _("Running in presentation mode")),
+                                                             G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
+                                                             -1,
+                                                             NULL,
+                                                             &error);
                 }
                 if (value != NULL) {
 			/* save the cookie */
@@ -143,29 +143,29 @@ screensaver_inhibit_dbus (TotemScrsaver *scr,
 		}
 
 	} else {
-                value = g_dbus_connection_invoke_method_sync (scr->priv->connection,
-                                                              GS_SERVICE,
-                                                              GS_PATH,
-                                                              GS_INTERFACE,
-                                                              "UnInhibit",
-                                                              g_variant_new ("(u)", scr->priv->cookie),
-                                                              G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
-                                                              -1,
-                                                              NULL,
-                                                              &error);
+                value = g_dbus_connection_call_sync (scr->priv->connection,
+                                                     GS_SERVICE,
+                                                     GS_PATH,
+                                                     GS_INTERFACE,
+                                                     "UnInhibit",
+                                                     g_variant_new ("(u)", scr->priv->cookie),
+                                                     G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
+                                                     -1,
+                                                     NULL,
+                                                     &error);
 		if (error && g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD)) {
 			/* try the old API */
                         g_clear_error (&error);
-                        value = g_dbus_connection_invoke_method_sync (scr->priv->connection,
-                                                                      GS_SERVICE,
-                                                                      GS_PATH,
-                                                                      GS_INTERFACE,
-                                                                      "AllowActivation",
-                                                                      g_variant_new ("()"),
-                                                                      G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
-                                                                      -1,
-                                                                      NULL,
-                                                                      &error);
+                        value = g_dbus_connection_call_sync (scr->priv->connection,
+                                                             GS_SERVICE,
+                                                             GS_PATH,
+                                                             GS_INTERFACE,
+                                                             "AllowActivation",
+                                                             g_variant_new ("()"),
+                                                             G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
+                                                             -1,
+                                                             NULL,
+                                                             &error);
                 }
                 if (value != NULL) {
 			/* clear the cookie */
diff --git a/shell/ev-application.c b/shell/ev-application.c
index 4331496..0f29da8 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -366,14 +366,14 @@ ev_application_register_uri (EvApplication *application,
 		return TRUE;
 
         /* FIXME: Don't make sync dbus calls, they block the UI! */
-        value = g_dbus_connection_invoke_method_sync
+        value = g_dbus_connection_call_sync
                    (application->connection,
                     "org.gnome.evince.Daemon",
                     "/org/gnome/evince/Daemon",
                     "org.gnome.evince.Daemon",
                     "RegisterDocument",
                     g_variant_new ("(s)", uri),
-                    G_DBUS_INVOKE_METHOD_FLAGS_NONE,
+                    G_DBUS_CALL_FLAGS_NONE,
                     -1,
                     NULL,
                     &error);
@@ -423,14 +423,14 @@ ev_application_register_uri (EvApplication *application,
 
         g_variant_builder_add (&builder, "u", timestamp);
 
-        value2 = g_dbus_connection_invoke_method_sync
+        value2 = g_dbus_connection_call_sync
                     (application->connection,
                      owner,
                      APPLICATION_DBUS_OBJECT_PATH,
                      APPLICATION_DBUS_INTERFACE,
                      "OpenURI",
                      g_variant_builder_end (&builder),
-                     G_DBUS_INVOKE_METHOD_FLAGS_NONE,
+                     G_DBUS_CALL_FLAGS_NONE,
                      -1,
                      NULL,
                      &error);
@@ -458,14 +458,14 @@ ev_application_unregister_uri (EvApplication *application,
 		return;
 
         /* FIXME: Don't make sync dbus calls, they block the UI! */
-        value = g_dbus_connection_invoke_method_sync
+        value = g_dbus_connection_call_sync
                    (application->connection,
                     "org.gnome.evince.Daemon",
                     "/org/gnome/evince/Daemon",
                     "org.gnome.evince.Daemon",
                     "UnregisterDocument",
                     g_variant_new ("(s)", uri),
-                    G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
+                    G_DBUS_CALL_FLAGS_NO_AUTO_START,
                     -1,
                     NULL,
                     &error);
diff --git a/shell/ev-media-player-keys.c b/shell/ev-media-player-keys.c
index ac364bb..b848906 100644
--- a/shell/ev-media-player-keys.c
+++ b/shell/ev-media-player-keys.c
@@ -86,29 +86,29 @@ ev_media_player_keys_grab_keys (EvMediaPlayerKeys *keys)
 	 * if a media player is there it gets higher priority on the keys (0 is
 	 * a special value having maximum priority).
 	 */
-        g_dbus_connection_invoke_method (keys->connection,
-                                         SD_NAME,
-                                         SD_OBJECT_PATH,
-                                         SD_INTERFACE,
-                                         "GrabMediaPlayerKeys",
-                                         g_variant_new ("(su)", "Evince", 1),
-                                         G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
-                                         -1,
-                                         NULL, NULL, NULL);
+        g_dbus_connection_call (keys->connection,
+                                SD_NAME,
+                                SD_OBJECT_PATH,
+                                SD_INTERFACE,
+                                "GrabMediaPlayerKeys",
+                                g_variant_new ("(su)", "Evince", 1),
+                                G_DBUS_CALL_FLAGS_NO_AUTO_START,
+                                -1,
+                                NULL, NULL, NULL);
 }
 
 static void
 ev_media_player_keys_release_keys (EvMediaPlayerKeys *keys)
 {
-        g_dbus_connection_invoke_method (keys->connection,
-                                         SD_NAME,
-                                         SD_OBJECT_PATH,
-                                         SD_INTERFACE,
-                                         "ReleaseMediaPlayerKeys",
-                                         g_variant_new ("(s)", "Evince"),
-                                         G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START,
-                                         -1,
-                                         NULL, NULL, NULL);
+        g_dbus_connection_call (keys->connection,
+                                SD_NAME,
+                                SD_OBJECT_PATH,
+                                SD_INTERFACE,
+                                "ReleaseMediaPlayerKeys",
+                                g_variant_new ("(s)", "Evince"),
+                                G_DBUS_CALL_FLAGS_NO_AUTO_START,
+                                -1,
+                                NULL, NULL, NULL);
 }
 
 static void



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