From a4632547f99d1b99f3be9da0a3ea5f51ff80245d Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 18 Jul 2009 16:41:13 +0200 Subject: [PATCH] Preserve metadata from the saved session when loading At this point, metadata can be set and read from the proxy item of any view and expected to be found after a restart. --- midori/midori-browser.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index c50606e5..bcff2942 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -5804,6 +5804,9 @@ midori_browser_add_item (MidoriBrowser* browser, const gchar* uri; const gchar* title; GtkWidget* view; + gint page; + KatzeItem* proxy_item; + GList* keys; g_return_val_if_fail (MIDORI_IS_BROWSER (browser), -1); g_return_val_if_fail (KATZE_IS_ITEM (item), -1); @@ -5818,7 +5821,18 @@ midori_browser_add_item (MidoriBrowser* browser, midori_view_set_uri (MIDORI_VIEW (view), uri); gtk_widget_show (view); - return midori_browser_add_tab (browser, view); + page = midori_browser_add_tab (browser, view); + proxy_item = midori_view_get_proxy_item (MIDORI_VIEW (view)); + if ((keys = katze_item_get_meta_keys (item))) + { + guint i = 0; + const gchar* key; + while ((key = g_list_nth_data (keys, i++))) + katze_item_set_meta_string (proxy_item, key, + katze_item_get_meta_string (item, key)); + g_list_free (keys); + } + return page; } /**