aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-07-23 05:07:52 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-07-27 20:58:50 +0800
commit6affbe33e90b4157380eff3dad6a9654c9a24443 (patch)
treeb82de645ced44be6c6aa28a0b0759ba17afb1624 /e-util
parenteba9b45f9e0e2a7f1a8d2d79f14d9e5f3aded19e (diff)
downloadgsoc2013-evolution-6affbe33e90b4157380eff3dad6a9654c9a24443.tar
gsoc2013-evolution-6affbe33e90b4157380eff3dad6a9654c9a24443.tar.gz
gsoc2013-evolution-6affbe33e90b4157380eff3dad6a9654c9a24443.tar.bz2
gsoc2013-evolution-6affbe33e90b4157380eff3dad6a9654c9a24443.tar.lz
gsoc2013-evolution-6affbe33e90b4157380eff3dad6a9654c9a24443.tar.xz
gsoc2013-evolution-6affbe33e90b4157380eff3dad6a9654c9a24443.tar.zst
gsoc2013-evolution-6affbe33e90b4157380eff3dad6a9654c9a24443.zip
Migrate ~/.evolution to XDG base directories.
Migration runs just before the main loop starts. It's just a sequence of local directory and file renames.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-datetime-format.c2
-rw-r--r--e-util/e-print.c2
-rw-r--r--e-util/e-signature.c39
-rw-r--r--e-util/e-util.c4
4 files changed, 38 insertions, 9 deletions
diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c
index 37226d471a..f927a275b8 100644
--- a/e-util/e-datetime-format.c
+++ b/e-util/e-datetime-format.c
@@ -25,7 +25,7 @@
#include "e-datetime-format.h"
#include "e-util.h"
-#define KEYS_FILENAME "datetime-formats"
+#define KEYS_FILENAME "datetime-formats.ini"
#define KEYS_GROUPNAME "formats"
#ifdef G_OS_WIN32
diff --git a/e-util/e-print.c b/e-util/e-print.c
index bb5ce9067a..756381f805 100644
--- a/e-util/e-print.c
+++ b/e-util/e-print.c
@@ -37,7 +37,7 @@
static gchar *
key_file_get_filename (void)
{
- return g_build_filename (e_get_user_data_dir (), "printing", NULL);
+ return g_build_filename (e_get_user_data_dir (), "printing.ini", NULL);
}
static void
diff --git a/e-util/e-signature.c b/e-util/e-signature.c
index c4ae7ed69d..6eb84c3704 100644
--- a/e-util/e-signature.c
+++ b/e-util/e-signature.c
@@ -32,6 +32,7 @@
#include <gconf/gconf-client.h>
#include <libedataserver/e-uid.h>
+#include <libedataserver/e-data-server-util.h>
#include "e-signature.h"
@@ -493,6 +494,24 @@ e_signature_set_from_xml (ESignature *signature, const gchar *xml)
break;
}
+ /* If the signature is not a script, replace the directory
+ * part with the current signatures directory. This makes
+ * moving the signatures directory transparent. */
+ if (!e_signature_get_is_script (signature)) {
+ const gchar *user_data_dir;
+ gchar *basename;
+ gchar *filename;
+
+ user_data_dir = e_get_user_data_dir ();
+
+ filename = signature->priv->filename;
+ basename = g_path_get_basename (filename);
+ signature->priv->filename = g_build_filename (
+ user_data_dir, "signatures", basename, NULL);
+ g_free (basename);
+ g_free (filename);
+ }
+
cur = cur->next;
}
@@ -544,13 +563,25 @@ e_signature_to_xml (ESignature *signature)
string = e_signature_get_filename (signature);
if (string != NULL) {
- node = xmlNewTextChild (
- root, NULL, (xmlChar *) "filename",
- (xmlChar *) string);
- if (e_signature_get_is_script (signature))
+
+ /* For scripts we save the full filename,
+ * for normal signatures just the basename. */
+ if (e_signature_get_is_script (signature)) {
+ node = xmlNewTextChild (
+ root, NULL, (xmlChar *) "filename",
+ (xmlChar *) string);
xmlSetProp (
node, (xmlChar *) "script",
(xmlChar *) "true");
+ } else {
+ gchar *basename;
+
+ basename = g_path_get_basename (string);
+ node = xmlNewTextChild (
+ root, NULL, (xmlChar *) "filename",
+ (xmlChar *) basename);
+ g_free (basename);
+ }
}
} else {
/* this is to make Evolution-1.4 and older 1.5 versions happy */
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 7d45709d2d..3f27c52941 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -1301,8 +1301,6 @@ get_font_options (void)
/* Evolution Locks for crash recovery */
-#define LOCK_FILE ".running"
-
static const gchar *
get_lock_filename (void)
{
@@ -1310,7 +1308,7 @@ get_lock_filename (void)
if (G_UNLIKELY (filename == NULL))
filename = g_build_filename (
- e_get_user_data_dir (), LOCK_FILE, NULL);
+ e_get_user_config_dir (), ".running", NULL);
return filename;
}