[latexila/gnome-3-16] app: create parent directories before saving accel file



commit 365efb344f1413aad73dbad0d80ce4356763df1b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Aug 18 11:42:59 2015 +0200

    app: create parent directories before saving accel file

 src/latexila_app.vala |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/latexila_app.vala b/src/latexila_app.vala
index 4b02e70..8455ee1 100644
--- a/src/latexila_app.vala
+++ b/src/latexila_app.vala
@@ -46,9 +46,23 @@ public class LatexilaApp : Gtk.Application
         shutdown.connect (() =>
         {
             hold ();
+
             Projects.get_default ().save ();
             MostUsedSymbols.get_default ().save ();
-            Gtk.AccelMap.save (get_accel_filename ());
+
+            /* Save accel file */
+            string accel_filename = get_accel_filename ();
+            File accel_file = File.new_for_path (accel_filename);
+            try
+            {
+                Latexila.utils_create_parent_directories (accel_file);
+                Gtk.AccelMap.save (accel_filename);
+            }
+            catch (Error error)
+            {
+                warning ("Error when saving accel file: %s", error.message);
+            }
+
             release ();
         });
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]