[evolution-data-server] Create the .gnome2_private directory if it does not exist



commit 69ae9383ff022173b89ea90e35ae3103aa1fa43f
Author: Fridrich Strba <fridrich strba bluewin ch>
Date:   Thu Mar 11 13:14:51 2010 +0100

    Create the .gnome2_private directory if it does not exist

 libedataserverui/e-passwords.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/libedataserverui/e-passwords.c b/libedataserverui/e-passwords.c
index e9e5a7e..cc1e2bb 100644
--- a/libedataserverui/e-passwords.c
+++ b/libedataserverui/e-passwords.c
@@ -175,6 +175,7 @@ ep_key_file_save (void)
 {
 	gchar *contents;
 	gchar *filename;
+	gchar* pathname;
 	gsize length = 0;
 	GError *error = NULL;
 
@@ -183,9 +184,14 @@ ep_key_file_save (void)
 
 	filename = ep_key_file_get_filename ();
 	contents = g_key_file_to_data (key_file, &length, &error);
+	pathname = g_path_get_dirname (filename);
 
-	if (!error)
+	if (!error) {
+		g_mkdir_with_parents (pathname, 0700);
 		g_file_set_contents (filename, contents, length, &error);
+	}
+	
+	g_free (pathname);
 
 	if (error != NULL) {
 		g_warning ("%s: %s", filename, error->message);



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