]> spindle.queued.net Git - midori/commitdiff
Backup the old session when resetting it in the Crash dialog
authorChristian Dywan <christian@twotoasts.de>
Wed, 30 Sep 2009 20:30:19 +0000 (22:30 +0200)
committerChristian Dywan <christian@twotoasts.de>
Wed, 30 Sep 2009 20:30:19 +0000 (22:30 +0200)
midori/main.c

index 4f46ba66ef0e21f4cb4a288b3d3ef14b643aecfe..2111c31d7cd675fb2358167660362d427c5d31a9 100644 (file)
@@ -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);
 }