[glib/wip/gapplication] Implement remote invoke



commit deaa13d0154e31f194987ca3c5d8bbd1f95005c5
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu May 20 22:57:49 2010 -0400

    Implement remote invoke

 gio/gunixapplication.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/gio/gunixapplication.c b/gio/gunixapplication.c
index b5c08a8..095992a 100644
--- a/gio/gunixapplication.c
+++ b/gio/gunixapplication.c
@@ -61,14 +61,14 @@ application_dbus_method_call (GDBusConnection       *connection,
       int i;
       GVariant *return_args;
       GVariant *result;
-      
+
       actions = g_new (char *, g_hash_table_size (app->priv->actions) + 1);
       g_hash_table_iter_init (&iter, app->priv->actions);
       i = 0;
       while (g_hash_table_iter_next (&iter, &key, &value))
         actions[i++] = key;
       actions[i] = NULL;
-      
+
       result = g_variant_new_strv ((const char *const*)actions, -1);
       return_args = g_variant_new_tuple (&result, 1);
       g_dbus_method_invocation_return_value (invocation, return_args);
@@ -302,10 +302,20 @@ _g_application_platform_on_actions_changed (GApplication *app)
 
 static void
 _g_application_platform_remote_invoke_action (GApplication  *app,
-					      const char    *action,
-					      guint          timestamp)
+                                              const char    *action,
+                                              guint          timestamp)
 {
-  /* TODO */
+  GVariant *result;
+  result = g_dbus_connection_call_sync (app->priv->session_bus,
+                                        app->priv->appid,
+                                        "/org/freedesktop/Application",
+                                        "org.freedesktop.Application",
+                                        "InvokeAction",
+                                        g_variant_new ("(su)",
+                                                       action,
+                                                       timestamp),
+                                        0, -1, NULL, NULL);
+  g_variant_unref (result);
 }
 
 static void



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