[gnome-games] gnomine: Create history directory before saving history



commit ae3e5287944b947c9d241da4de31d43f553e58cf
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Sep 27 11:36:08 2012 +1200

    gnomine: Create history directory before saving history

 gnomine/src/history.vala |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gnomine/src/history.vala b/gnomine/src/history.vala
index 377644a..f9a4e18 100644
--- a/gnomine/src/history.vala
+++ b/gnomine/src/history.vala
@@ -60,11 +60,13 @@ public class History
 
         try
         {
+            DirUtils.create_with_parents (Path.get_dirname (filename), 0775);
             FileUtils.set_contents (filename, contents);
         }
         catch (FileError e)
         {
-        }    
+            warning ("Failed to save history: %s", e.message);
+        }
     }
 
     private DateTime? parse_date (string date)



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