midori_browser_add_uri (MidoriBrowser* browser,
const gchar* uri)
{
- GtkWidget* view;
- gint n;
+ KatzeItem* item;
g_return_val_if_fail (MIDORI_IS_BROWSER (browser), -1);
g_return_val_if_fail (uri != NULL, -1);
- view = midori_view_new_with_title (NULL, browser->settings, FALSE);
- n = midori_browser_add_tab (browser, view);
- midori_view_set_uri (MIDORI_VIEW (view), uri);
- return n;
+ item = katze_item_new ();
+ item->uri = g_strdup (uri);
+ return midori_browser_add_item (browser, item);
}
/**
#endif
katze_assign (view->uri, g_strdup (""));
- katze_item_set_uri (view->item, "");
if (speeddial_markup == NULL)
speeddial_markup = prepare_speed_dial_html (view, TRUE);
webkit_web_view_load_html_string (
WEBKIT_WEB_VIEW (view->web_view), data, view->uri);
g_free (data);
- katze_item_set_uri (view->item, uri);
+ if (strcmp (view->item->uri, view->uri))
+ katze_item_set_uri (view->item, view->uri);
g_object_notify (G_OBJECT (view), "uri");
- return;
}
else if (katze_item_get_meta_integer (view->item, "delay") > 0)
{
_("Loading delayed either due to a recent crash or startup preferences."),
_("Load Page"),
NULL);
- katze_item_set_uri (view->item, uri);
+ if (strcmp (view->item->uri, uri))
+ katze_item_set_uri (view->item, uri);
g_object_notify (G_OBJECT (view), "uri");
}
else if (g_str_has_prefix (uri, "javascript:"))
else
{
katze_assign (view->uri, midori_uri_format_for_display (uri));
- katze_item_set_uri (view->item, uri);
+ if (strcmp (view->item->uri, view->uri))
+ katze_item_set_uri (view->item, view->uri);
g_object_notify (G_OBJECT (view), "uri");
webkit_web_view_open (WEBKIT_WEB_VIEW (view->web_view), uri);
}