From c848b24733635ffcaba80bb887ea5e116bc049fb Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Wed, 30 Sep 2009 22:30:19 +0200 Subject: [PATCH] Backup the old session when resetting it in the Crash dialog --- midori/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/midori/main.c b/midori/main.c index 4f46ba66..2111c31d 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1150,6 +1150,17 @@ static void button_reset_session_clicked_cb (GtkWidget* button, KatzeArray* session) { + gchar* config_file; + GError* error; + + config_file = build_config_filename ("session.old.xbel"); + error = NULL; + if (!midori_array_to_file (session, config_file, "xbel", &error)) + { + g_warning (_("The session couldn't be saved. %s"), error->message); + g_error_free (error); + } + g_free (config_file); katze_array_clear (session); gtk_widget_set_sensitive (button, FALSE); } -- 2.39.5