From e23ae0747e4648c3f15a11b49c4aaf196dd3423a Mon Sep 17 00:00:00 2001 From: Manuel QuiƱones Date: Wed, 04 Jan 2012 02:45:36 +0000 Subject: Improve session store and restore This is the review from Simon Schampijer of commit 14102bcd65f015dcbf12d1406df8ef7ffb64d13d . * the sessionstore code is moved into Browser, we do have set_history_index/get_history_index already there, the TabbedView does use that path for their requests about the history * Rename a few bits s/session/history and the return value from self.get_back_forward_list() Use back_forward_list as variable * Fold _get_history and _set_history into their appropriate 'mother' methods * Make set_history_index a bit cleaner, the API provided by webkitgtk does not seem to cleanly allow our usage like: get_current_item_index and go_to_back_forward_item(index) also the API does seem to miss a back_forward_list.get_length() (see the code we have to do in _items_history_as_list) there only exist a back_forward_list.get_back_length() and back_forward_list.get_forward_length(). Signed-off-by: Manuel QuiƱones --- (limited to 'webactivity.py') diff --git a/webactivity.py b/webactivity.py index 9ccbe4c..48eb780 100644 --- a/webactivity.py +++ b/webactivity.py @@ -399,7 +399,7 @@ class WebActivity(activity.Activity): link['color'], link['title'], link['owner'], -1, link['hash']) logging.debug('########## reading %s', data) - self._tabbed_view.set_session(self.model.data['history']) + self._tabbed_view.set_history(self.model.data['history']) for number, tab in enumerate(self.model.data['currents']): scrolled_window = self._tabbed_view.get_nth_page(number) browser = scrolled_window.get_child() @@ -431,7 +431,7 @@ class WebActivity(activity.Activity): else: self.metadata['title'] = browser.props.title - self.model.data['history'] = self._tabbed_view.get_session() + self.model.data['history'] = self._tabbed_view.get_history() current_tab = self._tabbed_view.get_current_page() self.model.data['current_tab'] = current_tab -- cgit v0.9.1