Commit 5d0020cb authored by Matthias Clasen's avatar Matthias Clasen Committed by Allison Karlitskaya

Adapt to object path conventions

Seems common to expect 'path == bus name with slashes'.
parent 8ee68a7b
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment