Make default-quit not apply if register=FALSE

Callers who are using g_application_unregistered_try_new are
likely wanting to continue doing something else if _register()
fails.  Change the semantics so that passing register=FALSE
unsets default-quit as well.  This means that a later _register()
call will send Activate but continue the process.

https://bugzilla.gnome.org/show_bug.cgi?id=622005
This commit is contained in:
Colin Walters
2010-06-18 14:19:57 -04:00
parent 7e0121dfe0
commit 8a2e7d371f
2 changed files with 25 additions and 7 deletions

View File

@@ -301,6 +301,10 @@ _g_application_platform_register (GApplication *app,
gboolean result;
guint registration_id;
/* Callers should have verified this */
g_assert (app->priv->registration_tried == FALSE);
app->priv->registration_tried = TRUE;
registration_id = g_dbus_connection_register_object (app->priv->session_bus,
app->priv->dbus_path,
&application_dbus_interface_info,
@@ -339,7 +343,7 @@ _g_application_platform_register (GApplication *app,
{
app->priv->is_remote = FALSE;
}
else if (app->priv->default_quit)
else
{
GVariantBuilder builder;
GVariant *message;
@@ -361,7 +365,8 @@ _g_application_platform_register (GApplication *app,
if (result)
g_variant_unref (result);
exit (0);
if (app->priv->default_quit)
exit (0);
}
done: