Handle 'append' as meta, neither object data nor argument

This is more in line with 'dont-write-history' and 'delay'.
This commit is contained in:
Christian Dywan 2011-12-07 23:15:04 +01:00
parent bd3c1b50fb
commit 64f9028eea
4 changed files with 9 additions and 12 deletions

View file

@ -1398,7 +1398,7 @@ midori_load_session (gpointer data)
session = midori_browser_get_proxy_array (browser); session = midori_browser_get_proxy_array (browser);
KATZE_ARRAY_FOREACH_ITEM (item, _session) KATZE_ARRAY_FOREACH_ITEM (item, _session)
{ {
g_object_set_data (G_OBJECT (item), "midori-view-append", (void*)1); katze_item_set_meta_integer (item, "append", 1);
katze_item_set_meta_integer (item, "dont-write-history", 1); katze_item_set_meta_integer (item, "dont-write-history", 1);
if (load_on_startup == MIDORI_STARTUP_DELAYED_PAGES if (load_on_startup == MIDORI_STARTUP_DELAYED_PAGES
&& katze_item_get_meta_integer (item, "delay") == -1) && katze_item_get_meta_integer (item, "delay") == -1)

View file

@ -1572,7 +1572,7 @@ _midori_browser_add_tab (MidoriBrowser* browser,
midori_browser_tab_leave_notify_event_cb, browser, midori_browser_tab_leave_notify_event_cb, browser,
NULL); NULL);
if (!g_object_get_data (G_OBJECT (view), "midori-view-append") && if (!katze_item_get_meta_boolean (item, "append") &&
katze_object_get_boolean (browser->settings, "open-tabs-next-to-current")) katze_object_get_boolean (browser->settings, "open-tabs-next-to-current"))
{ {
n = gtk_notebook_get_current_page (notebook) + 1; n = gtk_notebook_get_current_page (notebook) + 1;
@ -1581,6 +1581,7 @@ _midori_browser_add_tab (MidoriBrowser* browser,
n = -1; n = -1;
gtk_notebook_insert_page (notebook, view, tab_label, n); gtk_notebook_insert_page (notebook, view, tab_label, n);
katze_array_move_item (browser->proxy_array, item, n); katze_array_move_item (browser->proxy_array, item, n);
katze_item_set_meta_integer (item, "append", 0);
gtk_notebook_set_tab_reorderable (notebook, view, TRUE); gtk_notebook_set_tab_reorderable (notebook, view, TRUE);
gtk_notebook_set_tab_detachable (notebook, view, TRUE); gtk_notebook_set_tab_detachable (notebook, view, TRUE);
@ -7060,8 +7061,7 @@ 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);
view = midori_view_new_with_item (item, browser->settings, view = midori_view_new_with_item (item, browser->settings);
g_object_get_data (G_OBJECT (item), "midori-view-append") ? TRUE : FALSE);
page = midori_browser_add_tab (browser, view); page = midori_browser_add_tab (browser, view);
midori_view_set_uri (MIDORI_VIEW (view), uri); midori_view_set_uri (MIDORI_VIEW (view), uri);
return page; return page;

View file

@ -3269,14 +3269,15 @@ midori_view_new_with_title (const gchar* title,
{ {
KatzeItem* item = katze_item_new (); KatzeItem* item = katze_item_new ();
item->name = g_strdup (title); item->name = g_strdup (title);
return midori_view_new_with_item (item, settings, append); if (append)
katze_item_set_meta_integer (item, "append", 1);
return midori_view_new_with_item (item, settings);
} }
/** /**
* midori_view_new_with_item: * midori_view_new_with_item:
* @item: a #KatzeItem, or %NULL * @item: a #KatzeItem, or %NULL
* @settings: a #MidoriWebSettings, or %NULL * @settings: a #MidoriWebSettings, or %NULL
* @append: if %TRUE, the view should be appended
* *
* Creates a new view from an item that is visible by default. * Creates a new view from an item that is visible by default.
* *
@ -3286,14 +3287,11 @@ midori_view_new_with_title (const gchar* title,
**/ **/
GtkWidget* GtkWidget*
midori_view_new_with_item (KatzeItem* item, midori_view_new_with_item (KatzeItem* item,
MidoriWebSettings* settings, MidoriWebSettings* settings)
gboolean append)
{ {
MidoriView* view = g_object_new (MIDORI_TYPE_VIEW, NULL); MidoriView* view = g_object_new (MIDORI_TYPE_VIEW, NULL);
if (settings) if (settings)
_midori_view_set_settings (view, settings); _midori_view_set_settings (view, settings);
if (append)
g_object_set_data (G_OBJECT (view), "midori-view-append", (void*)1);
if (item) if (item)
katze_object_assign (view->item, katze_item_copy (item)); katze_object_assign (view->item, katze_item_copy (item));
gtk_widget_show ((GtkWidget*)view); gtk_widget_show ((GtkWidget*)view);

View file

@ -80,8 +80,7 @@ midori_view_new_with_title (const gchar* title,
GtkWidget* GtkWidget*
midori_view_new_with_item (KatzeItem* item, midori_view_new_with_item (KatzeItem* item,
MidoriWebSettings* settings, MidoriWebSettings* settings);
gboolean append);
void void
midori_view_set_settings (MidoriView* view, midori_view_set_settings (MidoriView* view,