Try hard to open bookmarks if they have an incomplete address

This commit is contained in:
Christian Dywan 2009-11-30 19:25:39 +01:00
parent a1cdf0bf4e
commit 557fdda228

View file

@ -2869,17 +2869,23 @@ midori_browser_open_bookmark (MidoriBrowser* browser,
KatzeItem* item) KatzeItem* item)
{ {
const gchar* uri = katze_item_get_uri (item); const gchar* uri = katze_item_get_uri (item);
gchar* uri_fixed;
if (!(uri && *uri)) if (!(uri && *uri))
return; return;
/* Imported bookmarks may lack a protocol */
uri_fixed = sokoke_magic_uri (uri, NULL);
/* FIXME: Use the same binary that is running right now */ /* FIXME: Use the same binary that is running right now */
if (katze_item_get_meta_integer (item, "app") != -1) if (katze_item_get_meta_integer (item, "app") != -1)
sokoke_spawn_program ("midori -a", uri, FALSE); sokoke_spawn_program ("midori -a", uri_fixed, FALSE);
else else
{ {
midori_browser_set_current_uri (browser, uri); midori_browser_set_current_uri (browser, uri_fixed);
gtk_widget_grab_focus (midori_browser_get_current_tab (browser)); gtk_widget_grab_focus (midori_browser_get_current_tab (browser));
} }
g_free (uri_fixed);
} }
static void static void