From 82277a80eae4e300935a6e90f053a5b22fac5850 Mon Sep 17 00:00:00 2001 From: TingPing Date: Mon, 1 Jul 2013 14:53:47 -0400 Subject: Fix urls with --existing --- src/common/dbus/dbus-client.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/common/dbus/dbus-client.c b/src/common/dbus/dbus-client.c index a30a75bd..6678a167 100644 --- a/src/common/dbus/dbus-client.c +++ b/src/common/dbus/dbus-client.c @@ -53,6 +53,7 @@ hexchat_remote (void) gboolean hexchat_running; GError *error = NULL; char *command = NULL; + int i; /* GnomeVFS >=2.15 uses D-Bus and threads, so threads should be * initialised before opening for the first time a D-Bus connection */ @@ -62,7 +63,7 @@ hexchat_remote (void) dbus_g_thread_init (); /* if there is nothing to do, return now. */ - if (!arg_existing || !(arg_url || arg_command)) { + if (!arg_existing || !(arg_url || arg_urls || arg_command)) { return; } @@ -114,6 +115,22 @@ hexchat_remote (void) } g_free (command); } + + if (arg_urls) + { + for (i = 0; i < g_strv_length(arg_urls); i++) + { + command = g_strdup_printf ("newserver %s", arg_urls[i]); + if (!dbus_g_proxy_call (remote_object, "Command", + &error, + G_TYPE_STRING, command, + G_TYPE_INVALID, G_TYPE_INVALID)) { + write_error (_("Failed to complete Command"), &error); + } + g_free (command); + } + g_strfreev (arg_urls); + } exit (0); } -- cgit 1.4.1