diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2013-02-07 16:23:17 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2013-02-08 06:01:59 +0800 |
commit | 65f5514fc4df4d6d7c88319d08b12820546e4d1b (patch) | |
tree | 5e4e5929a1e50657540ba51a8976eea4bcb8c1e8 /src | |
parent | be7b9d45477bd6762979f2046f41b713b2eefffe (diff) | |
download | gsoc2013-epiphany-65f5514fc4df4d6d7c88319d08b12820546e4d1b.tar gsoc2013-epiphany-65f5514fc4df4d6d7c88319d08b12820546e4d1b.tar.gz gsoc2013-epiphany-65f5514fc4df4d6d7c88319d08b12820546e4d1b.tar.bz2 gsoc2013-epiphany-65f5514fc4df4d6d7c88319d08b12820546e4d1b.tar.lz gsoc2013-epiphany-65f5514fc4df4d6d7c88319d08b12820546e4d1b.tar.xz gsoc2013-epiphany-65f5514fc4df4d6d7c88319d08b12820546e4d1b.tar.zst gsoc2013-epiphany-65f5514fc4df4d6d7c88319d08b12820546e4d1b.zip |
ephy-session.c: add ephy_session_clear()
https://bugzilla.gnome.org/show_bug.cgi?id=693297
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-private.h | 5 | ||||
-rw-r--r-- | src/ephy-session.c | 20 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/ephy-private.h b/src/ephy-private.h index 8a7757ba3..5e7b77a8e 100644 --- a/src/ephy-private.h +++ b/src/ephy-private.h @@ -29,6 +29,7 @@ #include "ephy-embed-event.h" #include "ephy-embed-private.h" #include "ephy-location-controller.h" +#include "ephy-session.h" #include "ephy-shell.h" #include "ephy-window.h" @@ -62,5 +63,9 @@ EphyShellStartupContext *ephy_shell_startup_context_new (EphyStartupFlags void _ephy_shell_create_instance (EphyEmbedShellMode mode); +/* EphySession */ + +void ephy_session_clear (EphySession *session); + #endif diff --git a/src/ephy-session.c b/src/ephy-session.c index 3ad9dbb3d..9fa15be8b 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -32,6 +32,7 @@ #include "ephy-gui.h" #include "ephy-notebook.h" #include "ephy-prefs.h" +#include "ephy-private.h" #include "ephy-settings.h" #include "ephy-shell.h" #include "ephy-string.h" @@ -1621,3 +1622,22 @@ ephy_session_resume_finish (EphySession *session, return !g_simple_async_result_propagate_error (simple, error); } + +void +ephy_session_clear (EphySession *session) +{ + EphyShell *shell; + GList *windows, *p; + + g_return_if_fail (EPHY_IS_SESSION (session)); + + shell = ephy_shell_get_default (); + windows = ephy_shell_get_windows (shell); + for (p = windows; p; p = p->next) + gtk_widget_destroy (GTK_WIDGET (p->data)); + g_queue_foreach (session->priv->closed_tabs, + (GFunc)closed_tab_free, NULL); + g_queue_clear (session->priv->closed_tabs); + + ephy_session_save (session, SESSION_STATE); +} |