[gtk+] Adapt to object path conventions



commit 5d0020cbd3dee8703f242423d120a94fa54dd8a8
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Nov 17 21:58:20 2011 -0500

    Adapt to object path conventions
    
    Seems common to expect 'path == bus name with slashes'.

 tests/testgmenu.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/tests/testgmenu.c b/tests/testgmenu.c
index 1f8b0d7..71006ad 100644
--- a/tests/testgmenu.c
+++ b/tests/testgmenu.c
@@ -920,6 +920,9 @@ button_clicked (GtkButton  *button,
   gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, 0);
 }
 
+#define BUS_NAME "org.gtk.TestMenus"
+#define OBJ_PATH "/org/gtk/TestMenus"
+
 int
 main (int argc, char *argv[])
 {
@@ -958,9 +961,9 @@ main (int argc, char *argv[])
   if (do_import)
     {
       g_print ("Getting menus from the bus...\n");
-      model = (GMenuModel*)g_menu_proxy_get (bus, "org.gtk.TestMenus", "/path");
+      model = (GMenuModel*)g_menu_proxy_get (bus, BUS_NAME, OBJ_PATH);
       g_print ("Getting actions from the bus...\n");
-      group = (GActionGroup*)g_dbus_action_group_new_sync (bus, "org.gtk.TestMenus", "/path", 0, NULL, NULL);
+      group = (GActionGroup*)g_dbus_action_group_new_sync (bus, BUS_NAME, OBJ_PATH, 0, NULL, NULL);
     }
   else
     {
@@ -976,19 +979,18 @@ main (int argc, char *argv[])
   if (do_export)
     {
       g_print ("Exporting menus on the bus...\n");
-      if (!g_menu_exporter_export (bus, "/path", model, &error))
+      if (!g_menu_exporter_export (bus, OBJ_PATH, model, &error))
         {
           g_warning ("Menu export failed: %s", error->message);
           exit (1);
         }
       g_print ("Exporting actions on the bus...\n");
-      if (!g_action_group_exporter_export (bus, "/path", group, &error))
+      if (!g_action_group_exporter_export (bus, OBJ_PATH, group, &error))
         {
           g_warning ("Action export failed: %s", error->message);
           exit (1);
         }
-      g_bus_own_name_on_connection (bus, "org.gtk.TestMenus",
-                                    0, NULL, NULL, NULL, NULL);
+      g_bus_own_name_on_connection (bus, BUS_NAME, 0, NULL, NULL, NULL, NULL);
     }
   else
     {



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