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:
parent
bd3c1b50fb
commit
64f9028eea
4 changed files with 9 additions and 12 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue