aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-06-03 13:03:29 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-06-03 13:03:29 +0200
commit1a21c582c91dfa1df8bcb8e2f822b2ad025c64f5 (patch)
tree24c3b8d5e9ddedb04572d8e9b95c83c72653109d
parent98538a540ba7a741a68b4cff6d3e192a43d61077 (diff)
downloadayatana-indicator-messages-1a21c582c91dfa1df8bcb8e2f822b2ad025c64f5.tar.gz
ayatana-indicator-messages-1a21c582c91dfa1df8bcb8e2f822b2ad025c64f5.tar.bz2
ayatana-indicator-messages-1a21c582c91dfa1df8bcb8e2f822b2ad025c64f5.zip
gactionmuxer: allow passing a NULL action group to insert()
-rw-r--r--src/gactionmuxer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gactionmuxer.c b/src/gactionmuxer.c
index cccfeda..e2cee3f 100644
--- a/src/gactionmuxer.c
+++ b/src/gactionmuxer.c
@@ -360,7 +360,7 @@ g_action_muxer_new (void)
* g_action_muxer_insert:
* @muxer: a #GActionMuxer
* @prefix: (allow-none): the prefix string for the action group, or NULL
- * @group: a #GActionGroup
+ * @group: (allow-none): a #GActionGroup, or NULL
*
* Adds the actions in @group to the list of actions provided by @muxer.
* @prefix is prefixed to each action name, such that for each action
@@ -374,6 +374,9 @@ g_action_muxer_new (void)
* If @prefix is <literal>NULL</literal>, the actions in @group will be added
* to @muxer without prefix.
*
+ * If @group is <literal>NULL</literal>, this function has the same effect as
+ * calling g_action_muxer_remove() with @prefix.
+ *
* There may only be one group per prefix (including the
* <literal>NULL</literal>-prefix). If a group has been added with @prefix in
* a previous call to this function, it will be removed.
@@ -394,6 +397,9 @@ g_action_muxer_insert (GActionMuxer *muxer,
g_action_muxer_remove (muxer, prefix);
+ if (!group)
+ return;
+
if (prefix)
{
prefix_copy = g_strdup (prefix);