Action group exporter: clean up the API

Make it look more like a typical GDBusConnection API with integer
registration ID and corresponding unexport call.  Kill the 'query' call.
This commit is contained in:
Ryan Lortie
2011-12-02 15:04:53 -05:00
parent 5a32769300
commit f7886d6adb
4 changed files with 45 additions and 119 deletions

View File

@@ -81,7 +81,7 @@ struct _GApplicationImpl
const gchar *bus_name;
gchar *object_path;
guint object_id;
gboolean actions_exported;
guint actions_id;
gboolean primary;
gpointer app;
};
@@ -247,9 +247,9 @@ g_application_impl_attempt_primary (GApplicationImpl *impl,
if (impl->object_id == 0)
return FALSE;
impl->actions_exported = g_action_group_dbus_export_start (impl->session_bus, impl->object_path, impl->app, error);
impl->actions_id = g_dbus_connection_export_action_group (impl->session_bus, impl->object_path, impl->app, error);
if (!impl->actions_exported)
if (impl->actions_id == 0)
return FALSE;
/* DBUS_NAME_FLAG_DO_NOT_QUEUE: 0x4 */
@@ -287,10 +287,10 @@ g_application_impl_stop_primary (GApplicationImpl *impl)
impl->object_id = 0;
}
if (impl->actions_exported)
if (impl->actions_id)
{
g_action_group_dbus_export_stop (impl->app);
impl->actions_exported = FALSE;
g_dbus_connection_unexport_action_group (impl->session_bus, impl->actions_id);
impl->actions_id = 0;
}
if (impl->primary)