GDesktopAppInfo: rewrite content type code
[platform/upstream/glib.git] / gio / tests / gdbus-example-peer.c
index 1a11c6d..b954f74 100644 (file)
@@ -103,7 +103,7 @@ handle_method_call (GDBusConnection       *connection,
       const gchar *greeting;
       gchar *response;
 
-      g_variant_get (parameters, "(s)", &greeting);
+      g_variant_get (parameters, "(&s)", &greeting);
       response = g_strdup_printf ("You said '%s'. KTHXBYE!", greeting);
       g_dbus_method_invocation_return_value (invocation,
                                              g_variant_new ("(s)", response));
@@ -121,7 +121,7 @@ static const GDBusInterfaceVTable interface_vtable =
 
 /* ---------------------------------------------------------------------------------------------------- */
 
-static void
+static gboolean
 on_new_connection (GDBusServer *server,
                    GDBusConnection *connection,
                    gpointer user_data)
@@ -152,6 +152,8 @@ on_new_connection (GDBusServer *server,
                                                        NULL,  /* user_data_free_func */
                                                        NULL); /* GError** */
   g_assert (registration_id > 0);
+
+  return TRUE;
 }
 
 /* ---------------------------------------------------------------------------------------------------- */
@@ -175,8 +177,6 @@ main (int argc, char *argv[])
 
   ret = 1;
 
-  g_type_init ();
-
   opt_address = NULL;
   opt_server = FALSE;
   opt_allow_anonymous = FALSE;
@@ -259,6 +259,7 @@ main (int argc, char *argv[])
       error = NULL;
       connection = g_dbus_connection_new_for_address_sync (opt_address,
                                                            G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT,
+                                                           NULL, /* GDBusAuthObserver */
                                                            NULL, /* GCancellable */
                                                            &error);
       if (connection == NULL)
@@ -279,6 +280,7 @@ main (int argc, char *argv[])
                                            "org.gtk.GDBus.TestPeerInterface",
                                            "HelloWorld",
                                            g_variant_new ("(s)", greeting),
+                                           G_VARIANT_TYPE ("(s)"),
                                            G_DBUS_CALL_FLAGS_NONE,
                                            -1,
                                            NULL,
@@ -289,7 +291,7 @@ main (int argc, char *argv[])
           g_error_free (error);
           goto out;
         }
-      g_variant_get (value, "(s)", &greeting_response);
+      g_variant_get (value, "(&s)", &greeting_response);
       g_print ("Server said: %s\n", greeting_response);
       g_variant_unref (value);