From: Christian Dywan Date: Sat, 4 Jul 2009 23:17:00 +0000 (+0100) Subject: Use metadata API to store and lookup the current page X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82e0a66de7211e9b9ff81d526f3e2cce00a2e3c9;p=midori Use metadata API to store and lookup the current page This effectively doesn't work yet as loading of metadata isn't implemented in XBEL. --- diff --git a/midori/main.c b/midori/main.c index 435113e9..203c20b5 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1269,6 +1269,7 @@ midori_load_session (gpointer data) KatzeArray* session; KatzeItem* item; guint i; + gint64 current; gchar** command = g_object_get_data (G_OBJECT (app), "execute-command"); browser = midori_app_create_browser (app); @@ -1305,8 +1306,11 @@ midori_load_session (gpointer data) i = 0; while ((item = katze_array_get_nth_item (_session, i++))) midori_browser_add_item (browser, item); - /* FIXME: Switch to the last active page */ - item = katze_array_get_nth_item (_session, 0); + current = katze_item_get_meta_integer (KATZE_ITEM (_session), "current"); + if (current < 0) + current = 0; + midori_browser_set_current_page (browser, current); + item = katze_array_get_nth_item (_session, current); if (!strcmp (katze_item_get_uri (item), "")) midori_browser_activate_action (browser, "Location"); g_object_unref (_session); diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 09df196d..3ac60cff 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -3973,6 +3973,8 @@ gtk_notebook_switch_page_cb (GtkWidget* notebook, gtk_window_set_title (GTK_WINDOW (browser), window_title); g_free (window_title); + katze_item_set_meta_integer (KATZE_ITEM (browser->proxy_array), "current", + midori_browser_get_current_page (browser)); g_object_notify (G_OBJECT (browser), "uri"); _midori_browser_set_statusbar_text (browser, NULL);