[Xfce4-commits] <midori:master> Backup the old session when resetting it in the Crash dialog

Christian Dywan noreply at xfce.org
Wed Sep 30 23:04:02 CEST 2009


Updating branch refs/heads/master
         to c848b24733635ffcaba80bb887ea5e116bc049fb (commit)
       from 3686db6f6f73c6deba1884b9f34a357596ede457 (commit)

commit c848b24733635ffcaba80bb887ea5e116bc049fb
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Sep 30 22:30:19 2009 +0200

    Backup the old session when resetting it in the Crash dialog

 midori/main.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index 4f46ba6..2111c31 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);
 }



More information about the Xfce4-commits mailing list