diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2012-10-08 17:39:31 +0800 |
---|---|---|
committer | Carlos Garcia Campos <cgarcia@igalia.com> | 2013-01-09 00:42:17 +0800 |
commit | 59b0526207799db5e5e3039963e1cb0d08cc7642 (patch) | |
tree | c285ec32121c07d0b8b226b1ccc7066427bd488f /src/ephy-shell.c | |
parent | b18992cb830ce129ba6b9b1132f0921414554bb8 (diff) | |
download | gsoc2013-epiphany-59b0526207799db5e5e3039963e1cb0d08cc7642.tar gsoc2013-epiphany-59b0526207799db5e5e3039963e1cb0d08cc7642.tar.gz gsoc2013-epiphany-59b0526207799db5e5e3039963e1cb0d08cc7642.tar.bz2 gsoc2013-epiphany-59b0526207799db5e5e3039963e1cb0d08cc7642.tar.lz gsoc2013-epiphany-59b0526207799db5e5e3039963e1cb0d08cc7642.tar.xz gsoc2013-epiphany-59b0526207799db5e5e3039963e1cb0d08cc7642.tar.zst gsoc2013-epiphany-59b0526207799db5e5e3039963e1cb0d08cc7642.zip |
ephy-session: Add ephy_session_resume() and use it instead of queueing a resume command
https://bugzilla.gnome.org/show_bug.cgi?id=641739
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r-- | src/ephy-shell.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 1b24387e2..ee947ff97 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -123,13 +123,6 @@ queue_commands (EphyShell *shell) ctx = shell->priv->startup_context; - /* We only get here when starting a new instance, so autoresume the - * session unless we are in application mode. */ - if (ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (shell)) != EPHY_EMBED_SHELL_MODE_APPLICATION) - ephy_session_queue_command (session, - EPHY_SESSION_CMD_RESUME_SESSION, - NULL, NULL, ctx->user_time, TRUE); - if (ctx->session_filename != NULL) ephy_session_load (session, (const char *)ctx->session_filename, ctx->user_time, NULL, NULL, NULL); @@ -261,13 +254,36 @@ ephy_shell_startup (GApplication* application) } static void +session_load_cb (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + EphySession *session = EPHY_SESSION (object); + EphyShell *shell = EPHY_SHELL (user_data); + + ephy_session_resume_finish (session, result, NULL); + queue_commands (shell); +} + +static void ephy_shell_activate (GApplication *application) { + EphyShell *shell = EPHY_SHELL (application); + /* - * We get here on each new instance (remote or not). Queue the + * We get here on each new instance (remote or not). Autoresume the + * session unless we are in application mode and queue the * commands. */ - queue_commands (EPHY_SHELL (application)); + if (ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (shell)) != EPHY_EMBED_SHELL_MODE_APPLICATION) { + EphyShellStartupContext *ctx; + + ctx = shell->priv->startup_context; + ephy_session_resume (EPHY_SESSION (ephy_shell_get_session (shell)), + ctx->user_time, NULL, session_load_cb, shell); + } + else + queue_commands (shell); } /* |