From bbc6fa88354e1cdd722479e83520bb0f8a3861cf Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 8 Sep 2015 12:18:14 +0200 Subject: document-portal: Allow dbus owner replacing --- document-portal/xdp-main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'document-portal') diff --git a/document-portal/xdp-main.c b/document-portal/xdp-main.c index e9efdaa..58ca742 100644 --- a/document-portal/xdp-main.c +++ b/document-portal/xdp-main.c @@ -563,10 +563,12 @@ set_one_signal_handler (int sig, static gboolean opt_verbose; static gboolean opt_daemon; +static gboolean opt_replace; static GOptionEntry entries[] = { { "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose, "Print debug information during command processing", NULL }, { "daemon", 'd', 0, G_OPTION_ARG_NONE, &opt_daemon, "Run in background", NULL }, + { "replace", 'r', 0, G_OPTION_ARG_NONE, &opt_replace, "Replace", NULL }, { NULL } }; @@ -677,7 +679,7 @@ main (int argc, owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, "org.freedesktop.portal.Documents", - G_BUS_NAME_OWNER_FLAGS_NONE, + G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT | (opt_replace ? G_BUS_NAME_OWNER_FLAGS_REPLACE : 0), on_bus_acquired, on_name_acquired, on_name_lost, -- cgit v1.2.1