gdbus-codegen: Fix up example to not use non-existant method
authorDavid Zeuthen <davidz@redhat.com>
Tue, 24 May 2011 11:34:30 +0000 (07:34 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Tue, 24 May 2011 11:34:30 +0000 (07:34 -0400)
Signed-off-by: David Zeuthen <davidz@redhat.com>
docs/reference/gio/gdbus-codegen.xml

index 5f1590d..a5b8068 100644 (file)
@@ -671,7 +671,7 @@ my_app_frobber_proxy_new_sync   (GDBusConnection     *connection,
     </para>
     <informalexample><programlisting><![CDATA[
 static gboolean
-on_handle_hello_world (MyAppFrobber           *object,
+on_handle_hello_world (MyAppFrobber           *interface,
                        GDBusMethodInvocation  *invocation,
                        const gchar            *greeting,
                        gpointer                user_data)
@@ -680,7 +680,7 @@ on_handle_hello_world (MyAppFrobber           *object,
     {
       gchar *response;
       response = g_strdup_printf ("Word! You said `%s'.", greeting);
-      my_app_complete_hello_world (object, invocation, response);
+      my_app_complete_hello_world (interface, invocation, response);
       g_free (response);
     }
   else
@@ -695,10 +695,10 @@ on_handle_hello_world (MyAppFrobber           *object,
 
   [...]
 
-  object = my_app_frobber_skeleton_new ();
-  my_app_frobber_set_verbose (object, TRUE);
+  interface = my_app_frobber_skeleton_new ();
+  my_app_frobber_set_verbose (interface, TRUE);
 
-  g_signal_connect (object,
+  g_signal_connect (interface,
                     "handle-hello-world",
                     G_CALLBACK (on_handle_hello_world),
                     some_user_data);
@@ -706,10 +706,13 @@ on_handle_hello_world (MyAppFrobber           *object,
   [...]
 
   error = NULL;
-  id = g_dbus_interface_register_object (G_DBUS_INTERFACE (object),
+  if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (interface),
                                          connection,
-                                         "/path/of/object",
-                                         &error);
+                                         "/path/of/dbus_object",
+                                         &error))
+    {
+      /* handle error */
+    }
 ]]></programlisting></informalexample>
     <para>
       To facilitate atomic changesets (multiple properties changing at