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



commit 636605ceab2ac2ed770470fe019be4591652c7a8
Author: Fridrich Strba <fridrich strba bluewin ch>
Date:   Mon Mar 15 00:47:31 2010 +0100

    Create the ~/.evolution directory if it does not exist

 libedataserver/e-categories.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/libedataserver/e-categories.c b/libedataserver/e-categories.c
index 24af1ef..9e8b2f2 100644
--- a/libedataserver/e-categories.c
+++ b/libedataserver/e-categories.c
@@ -194,13 +194,14 @@ idle_saver_cb (gpointer user_data)
 	GString *buffer;
 	gchar *contents;
 	gchar *filename;
+	gchar *pathname;
 	GError *error = NULL;
 
 	if (!save_is_pending)
 		goto exit;
 
 	filename = build_categories_filename ();
-
+	
 	g_debug ("Saving categories to \"%s\"", filename);
 
 	/* build the file contents */
@@ -209,11 +210,15 @@ idle_saver_cb (gpointer user_data)
 	g_string_append_len (buffer, "</categories>\n", 14);
 	contents = g_string_free (buffer, FALSE);
 
+	pathname = g_path_get_dirname (filename);
+	g_mkdir_with_parents (pathname, 0700);
+
 	if (!g_file_set_contents (filename, contents, -1, &error)) {
 		g_warning ("Unable to save categories: %s", error->message);
 		g_error_free (error);
 	}
 
+	g_free (pathname);
 	g_free (contents);
 	g_free (filename);
 	save_is_pending = FALSE;



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