Adapt to object path conventions

Seems common to expect 'path == bus name with slashes'.
This commit is contained in:
Matthias Clasen 2011-11-17 21:58:20 -05:00 committed by Ryan Lortie
parent 8ee68a7bf1
commit 5d0020cbd3

View File

@ -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
{