aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-session.c
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-05-25 19:12:53 +0800
committerXan Lopez <xan@igalia.com>2012-05-28 21:11:41 +0800
commit474d8dd8137e402efbec3011813f1ba6735080ba (patch)
tree66f1d23b12193b48c215e3457df58332c9bb3db7 /src/ephy-session.c
parent2fdcf51451a143730ba1287d2d802e1d36977073 (diff)
downloadgsoc2013-epiphany-474d8dd8137e402efbec3011813f1ba6735080ba.tar
gsoc2013-epiphany-474d8dd8137e402efbec3011813f1ba6735080ba.tar.gz
gsoc2013-epiphany-474d8dd8137e402efbec3011813f1ba6735080ba.tar.bz2
gsoc2013-epiphany-474d8dd8137e402efbec3011813f1ba6735080ba.tar.lz
gsoc2013-epiphany-474d8dd8137e402efbec3011813f1ba6735080ba.tar.xz
gsoc2013-epiphany-474d8dd8137e402efbec3011813f1ba6735080ba.tar.zst
gsoc2013-epiphany-474d8dd8137e402efbec3011813f1ba6735080ba.zip
ephy-session: simplify code to handle session resume
There's no need to tell the parse_embed method whether the window it gets is the resume window or not, it can figure it out by itself.
Diffstat (limited to 'src/ephy-session.c')
-rw-r--r--src/ephy-session.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 25a60a379..d06a766cf 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -915,10 +915,12 @@ confirm_before_recover (EphyWindow* window, char* url, char* title)
static void
parse_embed (xmlNodePtr child,
EphyWindow *window,
- gboolean is_first_window,
EphySession *session)
{
EphySessionPrivate *priv = session->priv;
+ gboolean is_first_window;
+
+ is_first_window = window == EPHY_WINDOW (priv->resume_window);
while (child != NULL)
{
@@ -950,12 +952,12 @@ parse_embed (xmlNodePtr child,
recover_url = (char *) url;
/* Reuse the window holding the recovery infobar instead of creating a new one. */
- if (is_first_window == TRUE && priv->resume_window != NULL)
+ if (is_first_window == TRUE && window != NULL)
{
EphyWebView *web_view;
EphyEmbed *embed;
- embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (priv->resume_window));
+ embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
web_view = ephy_embed_get_web_view (embed);
ephy_web_view_load_url (web_view, recover_url);
@@ -1115,8 +1117,7 @@ ephy_session_load (EphySession *session,
ephy_gui_window_update_user_time (widget, user_time);
/* Now add the tabs */
- parse_embed (child->children, window,
- window == EPHY_WINDOW (priv->resume_window), session);
+ parse_embed (child->children, window, session);
/* Set focus to something sane */
tmp = xmlGetProp (child, (xmlChar *) "active-tab");