From: Christian Dywan Date: Wed, 26 Dec 2007 23:29:22 +0000 (+0100) Subject: Command line uris should replace the default page. X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f4c2e3c14830eac63f700f5d6d9d7d9c0c79ba6;p=midori Command line uris should replace the default page. Don't open a blank page or the homepage respecitvely on startup if an uri is specified in the command line. --- diff --git a/src/main.c b/src/main.c index 4eb8bd09..e23eece8 100755 --- a/src/main.c +++ b/src/main.c @@ -215,21 +215,6 @@ int main(int argc, char** argv) } g_string_free(errorMessages, TRUE); - if(xbel_folder_is_empty(_session)) - { - XbelItem* item = xbel_bookmark_new(); - if(config->startup == CONFIG_STARTUP_HOMEPAGE) - xbel_bookmark_set_href(item, config->homepage); - else - xbel_bookmark_set_href(item, "about:blank"); - xbel_folder_append_item(_session, item); - } - g_free(configPath); - - accel_group = gtk_accel_group_new(); - stock_items_init(); - browsers = NULL; - // TODO: Handle any number of separate uris from argv // Open as many tabs as we have uris, seperated by pipes gchar* uri = argc > 1 ? strtok(g_strdup(argv[1]), "|") : NULL; @@ -244,6 +229,21 @@ int main(int argc, char** argv) } g_free(uri); + if(config->startup != CONFIG_STARTUP_SESSION || xbel_folder_is_empty(_session)) + { + XbelItem* item = xbel_bookmark_new(); + if(config->startup == CONFIG_STARTUP_BLANK) + xbel_bookmark_set_href(item, "about:blank"); + else + xbel_bookmark_set_href(item, config->homepage); + xbel_folder_prepend_item(_session, item); + } + g_free(configPath); + + accel_group = gtk_accel_group_new(); + stock_items_init(); + browsers = NULL; + session = xbel_folder_new(); CBrowser* browser = NULL; guint n = xbel_folder_get_n_items(_session);