diff options
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); +} |