From: Christian Dywan Date: Wed, 7 Dec 2011 22:15:04 +0000 (+0100) Subject: Handle 'append' as meta, neither object data nor argument X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64f9028eea326942a0492ea787290292fae24c3f;p=midori Handle 'append' as meta, neither object data nor argument This is more in line with 'dont-write-history' and 'delay'. --- diff --git a/midori/main.c b/midori/main.c index 14de34a1..2849e9dc 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1398,7 +1398,7 @@ midori_load_session (gpointer data) session = midori_browser_get_proxy_array (browser); 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); if (load_on_startup == MIDORI_STARTUP_DELAYED_PAGES && katze_item_get_meta_integer (item, "delay") == -1) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 2b720e52..b82bd2b4 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -1572,7 +1572,7 @@ _midori_browser_add_tab (MidoriBrowser* browser, midori_browser_tab_leave_notify_event_cb, browser, 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")) { n = gtk_notebook_get_current_page (notebook) + 1; @@ -1581,6 +1581,7 @@ _midori_browser_add_tab (MidoriBrowser* browser, n = -1; gtk_notebook_insert_page (notebook, view, tab_label, 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_detachable (notebook, view, TRUE); @@ -7060,8 +7061,7 @@ midori_browser_add_item (MidoriBrowser* browser, g_return_val_if_fail (KATZE_IS_ITEM (item), -1); uri = katze_item_get_uri (item); - view = midori_view_new_with_item (item, browser->settings, - g_object_get_data (G_OBJECT (item), "midori-view-append") ? TRUE : FALSE); + view = midori_view_new_with_item (item, browser->settings); page = midori_browser_add_tab (browser, view); midori_view_set_uri (MIDORI_VIEW (view), uri); return page; diff --git a/midori/midori-view.c b/midori/midori-view.c index 423c22ed..f55910dc 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -3269,14 +3269,15 @@ midori_view_new_with_title (const gchar* title, { KatzeItem* item = katze_item_new (); 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: * @item: a #KatzeItem, 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. * @@ -3286,14 +3287,11 @@ midori_view_new_with_title (const gchar* title, **/ GtkWidget* midori_view_new_with_item (KatzeItem* item, - MidoriWebSettings* settings, - gboolean append) + MidoriWebSettings* settings) { MidoriView* view = g_object_new (MIDORI_TYPE_VIEW, NULL); if (settings) _midori_view_set_settings (view, settings); - if (append) - g_object_set_data (G_OBJECT (view), "midori-view-append", (void*)1); if (item) katze_object_assign (view->item, katze_item_copy (item)); gtk_widget_show ((GtkWidget*)view); diff --git a/midori/midori-view.h b/midori/midori-view.h index 9b10d7b0..e96cf7a0 100644 --- a/midori/midori-view.h +++ b/midori/midori-view.h @@ -80,8 +80,7 @@ midori_view_new_with_title (const gchar* title, GtkWidget* midori_view_new_with_item (KatzeItem* item, - MidoriWebSettings* settings, - gboolean append); + MidoriWebSettings* settings); void midori_view_set_settings (MidoriView* view,