evolution r35256 - branches/mbarnes-composer/composer



Author: mbarnes
Date: Wed Mar 26 19:57:35 2008
New Revision: 35256
URL: http://svn.gnome.org/viewvc/evolution?rev=35256&view=rev

Log:
Use e_get_user_data_dir() to obtain the Evolution's user data directory.


Modified:
   branches/mbarnes-composer/composer/e-composer-autosave.c

Modified: branches/mbarnes-composer/composer/e-composer-autosave.c
==============================================================================
--- branches/mbarnes-composer/composer/e-composer-autosave.c	(original)
+++ branches/mbarnes-composer/composer/e-composer-autosave.c	Wed Mar 26 19:57:35 2008
@@ -6,6 +6,7 @@
 #include <glib/gstdio.h>
 
 #include <e-util/e-error.h>
+#include <e-util/e-util.h>
 #include <camel/camel-stream-fs.h>
 
 #define AUTOSAVE_SEED		".evolution-composer.autosave-XXXXXX"
@@ -23,21 +24,6 @@
 static GList *autosave_registry;
 static guint autosave_source_id;
 
-static const gchar *
-composer_autosave_get_dirname (void)
-{
-	/* XXX We really ought to centralize this to make sure all
-	 *     components agree on the directory for user data. */
-
-	static gchar *dirname = NULL;
-
-	if (G_UNLIKELY (dirname == NULL))
-		dirname = g_build_filename (
-			g_get_home_dir (), ".evolution", NULL);
-
-	return dirname;
-}
-
 static EMsgComposer *
 composer_autosave_registry_lookup (const gchar *basename)
 {
@@ -90,7 +76,7 @@
 		return TRUE;
 
 	state->filename = g_build_filename (
-		composer_autosave_get_dirname (), AUTOSAVE_SEED, NULL);
+		e_get_user_data_dir (), AUTOSAVE_SEED, NULL);
 
 	errno = 0;
 	if ((state->fd = g_mkstemp (state->filename)) >= 0)
@@ -150,7 +136,7 @@
 	const gchar *basename;
 	GList *orphans = NULL;
 
-	dirname = composer_autosave_get_dirname ();
+	dirname = e_get_user_data_dir ();
 	dir = g_dir_open (dirname, 0, error);
 	if (dir == NULL)
 		return NULL;



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