[glib/application-replace] fixup! GApplication: Add a way to replace a unique instance
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/application-replace] fixup! GApplication: Add a way to replace a unique instance
- Date: Sat, 3 Nov 2018 15:38:22 +0000 (UTC)
commit 6f370ee04cd51968b6f4255ac86ade37acf5c68e
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Nov 3 11:03:41 2018 -0400
fixup! GApplication: Add a way to replace a unique instance
Use a better variable name.
gio/gapplicationimpl-dbus.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/gio/gapplicationimpl-dbus.c b/gio/gapplicationimpl-dbus.c
index 46f16a7d4..76d67eec8 100644
--- a/gio/gapplicationimpl-dbus.c
+++ b/gio/gapplicationimpl-dbus.c
@@ -367,7 +367,7 @@ g_application_impl_attempt_primary (GApplicationImpl *impl,
NULL /* set_property */
};
GApplicationClass *app_class = G_APPLICATION_GET_CLASS (impl->app);
- GBusNameOwnerFlags flags;
+ GBusNameOwnerFlags name_owner_flags;
GApplicationFlags app_flags;
GVariant *reply;
guint32 rval;
@@ -448,7 +448,7 @@ g_application_impl_attempt_primary (GApplicationImpl *impl,
* the well-known name and fall back to remote mode (!is_primary)
* in the case that we can't do that.
*/
- flags = G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE;
+ name_owner_flags = G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE;
app_flags = g_application_get_flags (impl->app);
if (app_flags & G_APPLICATION_ALLOW_REPLACEMENT)
@@ -464,14 +464,18 @@ g_application_impl_attempt_primary (GApplicationImpl *impl,
impl,
NULL);
- flags |= G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT;
+ name_owner_flags |= G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT;
}
if (app_flags & G_APPLICATION_REPLACE)
- flags |= G_BUS_NAME_OWNER_FLAGS_REPLACE;
-
- reply = g_dbus_connection_call_sync (impl->session_bus, "org.freedesktop.DBus", "/org/freedesktop/DBus",
- "org.freedesktop.DBus", "RequestName",
- g_variant_new ("(su)", impl->bus_name, flags), G_VARIANT_TYPE ("(u)"),
+ name_owner_flags |= G_BUS_NAME_OWNER_FLAGS_REPLACE;
+
+ reply = g_dbus_connection_call_sync (impl->session_bus,
+ "org.freedesktop.DBus",
+ "/org/freedesktop/DBus",
+ "org.freedesktop.DBus",
+ "RequestName",
+ g_variant_new ("(su)", impl->bus_name, name_owner_flags),
+ G_VARIANT_TYPE ("(u)"),
0, -1, cancellable, error);
if (reply == NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]