Open blank page if an item with no URI is passed

This avoids the very confusing situation where the session
file contains no URI and critical warnings are visible.

Notably MIDORI_UNARMED can cause this.
This commit is contained in:
Christian Dywan 2010-11-18 21:22:12 +01:00
parent 1ac006804b
commit cb83843a28

View file

@ -6714,10 +6714,12 @@ midori_browser_add_item (MidoriBrowser* browser,
g_return_val_if_fail (KATZE_IS_ITEM (item), -1); g_return_val_if_fail (KATZE_IS_ITEM (item), -1);
uri = katze_item_get_uri (item); uri = katze_item_get_uri (item);
if (!uri)
uri = "about:blank";
title = katze_item_get_name (item); title = katze_item_get_name (item);
/* Blank pages should not be delayed */ /* Blank pages should not be delayed */
if (katze_item_get_meta_integer (item, "delay") > 0 if (katze_item_get_meta_integer (item, "delay") > 0
&& uri != NULL && strcmp (uri, "about:blank") != 0) && strcmp (uri, "about:blank") != 0)
{ {
gchar* new_uri = g_strdup_printf ("pause:%s", uri); gchar* new_uri = g_strdup_printf ("pause:%s", uri);
view = midori_view_new_with_uri (new_uri, title, browser->settings); view = midori_view_new_with_uri (new_uri, title, browser->settings);