GApplication: allow null application_id

GApplication application ID is now permitted to be NULL, in which case
G_APPLICATION_NON_UNIQUE will be implicitly enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=671249
This commit is contained in:
Ryan Lortie
2012-03-03 11:31:05 -05:00
parent d959ace72c
commit 16f92a33ac
3 changed files with 45 additions and 27 deletions

View File

@@ -194,6 +194,10 @@ application_path_from_appid (const gchar *appid)
{
gchar *appid_path, *iter;
if (appid == NULL)
/* this is a private implementation detail */
return g_strdup ("/org/gtk/Application/anonymous");
appid_path = g_strconcat ("/", appid, NULL);
for (iter = appid_path; *iter; iter++)
{
@@ -358,6 +362,8 @@ g_application_impl_register (GApplication *application,
GDBusActionGroup *actions;
GApplicationImpl *impl;
g_assert ((flags & G_APPLICATION_NON_UNIQUE) || appid != NULL);
impl = g_slice_new0 (GApplicationImpl);
impl->app = application;