Avoid setting the same URI on the item given

This commit is contained in:
Christian Dywan 2011-12-07 23:19:32 +01:00
parent 64f9028eea
commit c44f76abb9
2 changed files with 10 additions and 11 deletions

View file

@ -7080,16 +7080,14 @@ gint
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);
}
/**

View file

@ -3841,7 +3841,6 @@ midori_view_set_uri (MidoriView* view,
#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);
@ -3955,9 +3954,9 @@ midori_view_set_uri (MidoriView* view,
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)
{
@ -3969,6 +3968,7 @@ midori_view_set_uri (MidoriView* view,
_("Loading delayed either due to a recent crash or startup preferences."),
_("Load Page"),
NULL);
if (strcmp (view->item->uri, uri))
katze_item_set_uri (view->item, uri);
g_object_notify (G_OBJECT (view), "uri");
}
@ -3992,7 +3992,8 @@ midori_view_set_uri (MidoriView* view,
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);
}