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.
This commit is contained in:
parent
ab6ecc1625
commit
82e0a66de7
2 changed files with 8 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue