if (view->menu_item)
gtk_label_set_text (GTK_LABEL (gtk_bin_get_child (GTK_BIN (
view->menu_item))), title);
- if (view->item)
- katze_item_set_name (view->item, title);
+ katze_item_set_name (view->item, title);
#undef title
}
GdkPixbuf* icon,
const gchar* icon_name)
{
- if (view->item)
- katze_item_set_icon (view->item, icon_name);
+ katze_item_set_icon (view->item, icon_name);
katze_object_assign (view->icon, icon);
g_object_notify (G_OBJECT (view), "icon");
uri = webkit_web_frame_get_uri (web_frame);
g_return_if_fail (uri != NULL);
- katze_assign (view->uri, sokoke_format_uri_for_display (uri));
katze_assign (view->icon_uri, NULL);
- /* FIXME: Create a proxy item if we don't have one.
- * We should either always create it, or not rely on it */
- if (!view->item)
- midori_view_get_proxy_item (view);
+ if (g_strcmp0 (uri, katze_item_get_uri (view->item)))
+ {
+ katze_assign (view->uri, sokoke_format_uri_for_display (uri));
+ katze_item_set_uri (view->item, uri);
+ }
- katze_item_set_uri (view->item, uri);
katze_item_set_added (view->item, time (NULL));
g_object_notify (G_OBJECT (view), "uri");
MidoriView* view)
{
gint value = (gint)gtk_adjustment_get_value (hadjustment);
- if (view->item)
- katze_item_set_meta_integer (view->item, "scrollh", value);
+ katze_item_set_meta_integer (view->item, "scrollh", value);
}
static void
MidoriView* view)
{
gint value = (gint)gtk_adjustment_get_value (vadjustment);
- if (view->item)
- katze_item_set_meta_integer (view->item, "scrollv", value);
+ katze_item_set_meta_integer (view->item, "scrollv", value);
}
static void
view->selected_text = NULL;
view->news_feeds = katze_array_new (KATZE_TYPE_ITEM);
- view->item = NULL;
+ view->item = katze_item_new ();
+
view->scrollh = view->scrollv = -2;
view->back_forward_set = FALSE;
GTK_SHADOW_NONE);
gtk_container_add (GTK_CONTAINER (view), view->scrolled_window);
+ g_signal_connect (view->item, "meta-data-changed",
+ G_CALLBACK (midori_view_item_meta_data_changed), view);
g_signal_connect (view->scrolled_window, "notify::hadjustment",
G_CALLBACK (midori_view_notify_hadjustment_cb), view);
g_signal_connect (view->scrolled_window, "notify::vadjustment",
if (view->settings)
g_signal_handlers_disconnect_by_func (view->settings,
midori_view_settings_notify_cb, view);
- if (view->item)
- g_signal_handlers_disconnect_by_func (view->item,
- midori_view_item_meta_data_changed, view);
+ g_signal_handlers_disconnect_by_func (view->item,
+ midori_view_item_meta_data_changed, view);
if (view->thumb_view)
gtk_widget_destroy (view->thumb_view);
break;
case PROP_MINIMIZED:
view->minimized = g_value_get_boolean (value);
- if (view->item)
- {
- g_signal_handlers_block_by_func (view->item,
- midori_view_item_meta_data_changed, view);
- katze_item_set_meta_integer (view->item, "minimized",
- view->minimized ? 1 : -1);
- g_signal_handlers_unblock_by_func (view->item,
- midori_view_item_meta_data_changed, view);
- }
+ g_signal_handlers_block_by_func (view->item,
+ midori_view_item_meta_data_changed, view);
+ katze_item_set_meta_integer (view->item, "minimized",
+ view->minimized ? 1 : -1);
+ g_signal_handlers_unblock_by_func (view->item,
+ midori_view_item_meta_data_changed, view);
if (view->tab_label)
sokoke_widget_set_visible (view->tab_title, !view->minimized);
break;
gchar* filepath;
katze_assign (view->uri, g_strdup (""));
+ katze_item_set_uri (view->item, "");
filepath = sokoke_find_data_filename ("midori/res/speeddial-head.html");
g_file_get_contents (filepath, &speed_dial_head, NULL, NULL);
WEBKIT_WEB_VIEW (view->web_view), data, view->uri);
g_free (data);
g_object_notify (G_OBJECT (view), "uri");
- if (view->item)
- katze_item_set_uri (view->item, uri);
+ katze_item_set_uri (view->item, uri);
return;
}
else if (g_str_has_prefix (uri, "pause:"))
NULL);
g_free (title);
g_object_notify (G_OBJECT (view), "uri");
- if (view->item)
- katze_item_set_uri (view->item, uri);
+ katze_item_set_uri (view->item, uri);
}
else if (g_str_has_prefix (uri, "javascript:"))
{
{
katze_assign (view->uri, sokoke_format_uri_for_display (uri));
g_object_notify (G_OBJECT (view), "uri");
- if (view->item)
- katze_item_set_uri (view->item, uri);
+ katze_item_set_uri (view->item, uri);
webkit_web_view_open (WEBKIT_WEB_VIEW (view->web_view), uri);
}
}
* Retrieves a proxy item that can be used for bookmark storage as
* well as session management.
*
- * The item is created on the first call and will be updated to reflect
- * changes to the title and uri automatically.
+ * The item reflects changes to the title and uri automatically.
*
* Return value: the proxy #KatzeItem
**/
{
g_return_val_if_fail (MIDORI_IS_VIEW (view), NULL);
- if (!view->item)
- {
- view->item = katze_item_new ();
- g_signal_connect (view->item, "meta-data-changed",
- G_CALLBACK (midori_view_item_meta_data_changed), view);
- }
return view->item;
}