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.
This commit is contained in:
Christian Dywan 2007-12-27 00:29:22 +01:00
parent 84ceb56bf8
commit 3f4c2e3c14
1 changed files with 15 additions and 15 deletions

View File

@ -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);