aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-07-09 04:59:11 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-07-09 04:59:11 +0800
commitf92b45d7df69c958bb4fc606831bc51ee2bcc914 (patch)
tree704ffb1fe55bb37673436695c2d4e49efab8e7b4
parentae4e6007efece29bf587f3193e7c57ad7f7d81dc (diff)
downloadgsoc2013-evolution-f92b45d7df69c958bb4fc606831bc51ee2bcc914.tar
gsoc2013-evolution-f92b45d7df69c958bb4fc606831bc51ee2bcc914.tar.gz
gsoc2013-evolution-f92b45d7df69c958bb4fc606831bc51ee2bcc914.tar.bz2
gsoc2013-evolution-f92b45d7df69c958bb4fc606831bc51ee2bcc914.tar.lz
gsoc2013-evolution-f92b45d7df69c958bb4fc606831bc51ee2bcc914.tar.xz
gsoc2013-evolution-f92b45d7df69c958bb4fc606831bc51ee2bcc914.tar.zst
gsoc2013-evolution-f92b45d7df69c958bb4fc606831bc51ee2bcc914.zip
Fix places where "~/.evolution" is hard-coded.
Also replace "$USER_DATA_DIR/cache" path constructions with e_get_user_cache_dir().
-rw-r--r--doc/reference/shell/eshell-sections.txt1
-rw-r--r--doc/reference/shell/tmpl/e-util.sgml9
-rw-r--r--doc/reference/shell/tmpl/eshell-unused.sgml8
-rw-r--r--e-util/e-mktemp.c9
-rw-r--r--e-util/e-util.c20
-rw-r--r--e-util/e-util.h5
-rw-r--r--mail/em-format-html.c8
-rw-r--r--shell/Makefile.am7
-rw-r--r--shell/killev.c9
9 files changed, 30 insertions, 46 deletions
diff --git a/doc/reference/shell/eshell-sections.txt b/doc/reference/shell/eshell-sections.txt
index 7ee56ab6bf..ee39dfd83f 100644
--- a/doc/reference/shell/eshell-sections.txt
+++ b/doc/reference/shell/eshell-sections.txt
@@ -657,7 +657,6 @@ e_run_signature_script
<SECTION>
<FILE>e-util</FILE>
<TITLE>Miscellaneous Utilities</TITLE>
-e_get_user_data_dir
e_get_gnome2_user_dir
e_get_accels_filename
e_show_uri
diff --git a/doc/reference/shell/tmpl/e-util.sgml b/doc/reference/shell/tmpl/e-util.sgml
index 1d17258128..b07000df3f 100644
--- a/doc/reference/shell/tmpl/e-util.sgml
+++ b/doc/reference/shell/tmpl/e-util.sgml
@@ -20,15 +20,6 @@ Miscellaneous Utilities
<!-- ##### SECTION Image ##### -->
-<!-- ##### FUNCTION e_get_user_data_dir ##### -->
-<para>
-
-</para>
-
-@void:
-@Returns:
-
-
<!-- ##### FUNCTION e_get_gnome2_user_dir ##### -->
<para>
diff --git a/doc/reference/shell/tmpl/eshell-unused.sgml b/doc/reference/shell/tmpl/eshell-unused.sgml
index 11fa5036ae..596abb3063 100644
--- a/doc/reference/shell/tmpl/eshell-unused.sgml
+++ b/doc/reference/shell/tmpl/eshell-unused.sgml
@@ -11,6 +11,14 @@
@window:
+<!-- ##### FUNCTION e_get_user_data_dir ##### -->
+<para>
+
+</para>
+
+@void:
+@Returns:
+
<!-- ##### FUNCTION e_shell_content_get_search_name ##### -->
<para>
diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c
index e53ea60b69..064c01997a 100644
--- a/e-util/e-mktemp.c
+++ b/e-util/e-mktemp.c
@@ -36,7 +36,6 @@
#include <stdio.h>
#include <time.h>
-#include <libedataserver/e-data-server-util.h>
#include "e-util.h"
#include "e-mktemp.h"
@@ -109,9 +108,11 @@ get_dir (gboolean make)
static time_t last = 0;
#ifdef TEMP_HOME
- gchar *tmpdir = NULL;
- tmpdir = g_build_filename(e_get_user_data_dir (),
- "cache", "tmp", NULL);
+ const gchar *user_cache_dir;
+ gchar *tmpdir;
+
+ user_cache_dir = e_get_user_cache_dir ();
+ tmpdir = g_build_filename (user_cache_dir, "tmp", NULL);
path = g_string_new(tmpdir);
if (make && g_mkdir_with_parents(tmpdir, 0777) == -1) {
g_string_free(path, TRUE);
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 956f7d009f..4b73fd7865 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -59,26 +59,6 @@
#include "e-util-private.h"
/**
- * e_get_user_data_dir:
- *
- * Returns the base directory for Evolution-specific user data.
- * The string is owned by Evolution and must not be modified or freed.
- *
- * Returns: base directory for user data
- **/
-const gchar *
-e_get_user_data_dir (void)
-{
- static gchar *dirname = NULL;
-
- if (G_UNLIKELY (dirname == NULL))
- dirname = g_build_filename (
- g_get_home_dir (), ".evolution", NULL);
-
- return dirname;
-}
-
-/**
* e_get_gnome2_user_dir:
*
* Returns the base directory for user data, according to libgnome.
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 6f7e56b07f..e3ce5cb103 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -30,6 +30,10 @@
#include <e-util/e-marshal.h>
+/* e_get_user_data_dir() used to live here, so #include its new home
+ * for backward-compatibility (not that we really care about that). */
+#include <libedataserver/e-data-server-util.h>
+
/* Convenience macro to help migrate from libglade to GtkBuilder.
* Use it as a direct replacement for glade_xml_get_widget(). */
#define e_builder_get_widget(builder, name) \
@@ -46,7 +50,6 @@ typedef enum {
typedef void (*ETypeFunc) (GType type, gpointer user_data);
-const gchar * e_get_user_data_dir (void);
const gchar * e_get_gnome2_user_dir (void);
const gchar * e_get_accels_filename (void);
void e_show_uri (GtkWindow *parent,
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index c63ed28085..55cbca13fc 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -761,7 +761,7 @@ efh_class_init (EMFormatHTMLClass *class)
{
GObjectClass *object_class;
EMFormatClass *format_class;
- gchar *pathname;
+ const gchar *user_cache_dir;
parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EMFormatHTMLPrivate));
@@ -908,14 +908,12 @@ efh_class_init (EMFormatHTMLClass *class)
G_PARAM_READABLE));
/* cache expiry - 2 hour access, 1 day max */
- pathname = g_build_filename (
- e_get_user_data_dir (), "cache", NULL);
- emfh_http_cache = camel_data_cache_new (pathname, NULL);
+ user_cache_dir = e_get_user_cache_dir ();
+ emfh_http_cache = camel_data_cache_new (user_cache_dir, NULL);
if (emfh_http_cache) {
camel_data_cache_set_expire_age(emfh_http_cache, 24*60*60);
camel_data_cache_set_expire_access(emfh_http_cache, 2*60*60);
}
- g_free (pathname);
}
static void
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 2f044e420e..2fc70ae490 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -156,11 +156,14 @@ endif
killev_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- $(GNOME_PLATFORM_CFLAGS)
+ $(GNOME_PLATFORM_CFLAGS) \
+ $(EVOLUTION_DATA_SERVER_CFLAGS)
killev_SOURCES = killev.c
-killev_LDADD = $(GNOME_PLATFORM_LIBS)
+killev_LDADD = \
+ $(GNOME_PLATFORM_LIBS) \
+ $(EVOLUTION_DATA_SERVER_LIBS)
# Misc stuff
diff --git a/shell/killev.c b/shell/killev.c
index d1eb523495..16849eec42 100644
--- a/shell/killev.c
+++ b/shell/killev.c
@@ -29,6 +29,8 @@
#include <gio/gio.h>
#include <glib/gi18n.h>
+#include <libedataserver/e-data-server-util.h>
+
/* Seconds to wait after asking Evolution to terminate gracefully.
* If the process has not terminated before the timeout expires,
* then we get violent. */
@@ -97,6 +99,7 @@ main (gint argc, gchar **argv)
{
GFile *pid_file;
GFileMonitor *monitor;
+ const gchar *user_config_dir;
gchar *filename;
GError *error = NULL;
@@ -106,10 +109,8 @@ main (gint argc, gchar **argv)
g_type_init ();
- /* XXX If e_get_user_data_dir() ever gets moved to libedataserver,
- * use that instead of hard-coding the directory path here. */
- filename = g_build_filename (
- g_get_home_dir (), ".evolution", ".running", NULL);
+ user_config_dir = e_get_user_config_dir ();
+ filename = g_build_filename (user_config_dir, ".running", NULL);
pid_file = g_file_new_for_path (filename);
g_free (filename);