From: Christian Dywan Date: Wed, 30 Sep 2009 20:30:19 +0000 (+0200) Subject: Backup the old session when resetting it in the Crash dialog X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c848b24733635ffcaba80bb887ea5e116bc049fb;p=midori Backup the old session when resetting it in the Crash dialog --- 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); }