diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-02-01 04:03:38 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-02-01 04:03:38 +0800 |
commit | 0541bcb1e3d64c8ebbd9d514641917def2515f97 (patch) | |
tree | 65c59efdb54212cceea1d0bbdf7cf87da776fe59 /src/ephy-main.c | |
parent | f6afe77cb705b9ba2f356ed3d44bdc0201887e4f (diff) | |
download | gsoc2013-epiphany-0541bcb1e3d64c8ebbd9d514641917def2515f97.tar.gz gsoc2013-epiphany-0541bcb1e3d64c8ebbd9d514641917def2515f97.tar.zst gsoc2013-epiphany-0541bcb1e3d64c8ebbd9d514641917def2515f97.zip |
Change the DBUS interface to sending all the uris at one as string array.
2006-01-31 Christian Persch <chpe@cvs.gnome.org>
* data/epiphany-service.xml:
* src/ephy-activation.c: (ephy_activation_load_uris):
* src/ephy-activation.h:
* src/ephy-main.c: (unref_proxy_reply_cb), (open_urls):
Change the DBUS interface to sending all the uris at one
as string array.
Diffstat (limited to 'src/ephy-main.c')
-rw-r--r-- | src/ephy-main.c | 55 |
1 files changed, 20 insertions, 35 deletions
diff --git a/src/ephy-main.c b/src/ephy-main.c index 7ee41baae..be5954587 100644 --- a/src/ephy-main.c +++ b/src/ephy-main.c @@ -66,7 +66,7 @@ static gboolean private_instance = FALSE; static char *session_filename = NULL; static char *bookmark_url = NULL; static char *bookmarks_file = NULL; -static char **remaining_arguments = NULL; +static char **extra_arguments = NULL; static const GOptionEntry option_entries[] = { @@ -84,7 +84,7 @@ static const GOptionEntry option_entries[] = N_("Add a bookmark"), N_("URL") }, { "private-instance", 0, 0, G_OPTION_ARG_NONE, &private_instance, N_("Start a private instance"), NULL }, - { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &remaining_arguments, + { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &extra_arguments, "", "" }, { NULL } }; @@ -354,7 +354,7 @@ unref_proxy_reply_cb (DBusGProxy *proxy, if (error != NULL) { g_warning ("An error occured while calling remote method: %s", error->message); - g_error_free (error); + g_error_free (error);// FIXME??? } g_object_unref (proxy); @@ -370,48 +370,33 @@ open_urls (DBusGProxy *proxy, guint32 user_time, GError **error) { - const char *options = "new-window"; - int i; + static const char *empty_arguments[] = { "", NULL }; + GString *options; + + options = g_string_sized_new (64); if (open_in_new_window) { - options = "new-window"; + g_string_append (options, "new-window,"); } - else if (open_in_new_tab) + if (open_in_new_tab) { - options = "new-tab"; + g_string_append (options, "new-tab,"); } - if (remaining_arguments == NULL) + org_gnome_Epiphany_load_uris_async + (proxy, + extra_arguments ? (const char**) extra_arguments : (const char**)empty_arguments, + options->str, user_time, + unref_proxy_reply_cb, NULL); + + if (extra_arguments) { - /* Homepage or resume */ - org_gnome_Epiphany_load_url_async - (proxy, "", options, user_time, - unref_proxy_reply_cb, NULL /* FIXME! */); + g_strfreev (extra_arguments); + extra_arguments = NULL; } - else - { - for (i = 0; remaining_arguments[i] != NULL; ++i) - { - char *path; - - path = remaining_arguments[i]; - /* path = path_from_command_line_arg (args[i]); */ - g_object_ref (proxy); - - org_gnome_Epiphany_load_url_async - (proxy, path, options, user_time, - unref_proxy_reply_cb, NULL /* FIXME */); - - /* g_free (path); */ - } - - g_strfreev (remaining_arguments); - remaining_arguments = NULL; - - ephy_object_idle_unref (proxy); - } + g_string_free (options, TRUE); return TRUE; } |