Menu model exporter: clean up the API

Give it the same treatment as the exporter for GActionGroup just got.

There is a wart here: the exporter attempt to re-enter GDBusConnection
when it is freed in order to cancel outstanding name watches.
GDBusConnection holds its own lock while calling the destroy notify, so
the attempt at reentrancy results in a deadlock.

We have a workaround to deal with that for now...
This commit is contained in:
Ryan Lortie
2011-12-02 15:36:15 -05:00
parent a9f03596fa
commit cfbc1b5a4b
3 changed files with 58 additions and 145 deletions

View File

@@ -27,16 +27,13 @@
G_BEGIN_DECLS
gboolean g_menu_model_dbus_export_start (GDBusConnection *connection,
const gchar *object_path,
GMenuModel *menu,
GError **error);
guint g_dbus_connection_export_menu_model (GDBusConnection *connection,
const gchar *object_path,
GMenuModel *menu,
GError **error);
gboolean g_menu_model_dbus_export_stop (GMenuModel *menu);
gboolean g_menu_model_dbus_export_query (GMenuModel *menu,
GDBusConnection **connection,
const gchar **object_path);
gboolean g_dbus_connection_unexport_menu_model (GDBusConnection *connection,
guint export_id);
G_END_DECLS