aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-backend.c
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 /shell/e-shell-backend.c
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 'shell/e-shell-backend.c')
-rw-r--r--shell/e-shell-backend.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c
index 570e58db95..c0fd14aaa3 100644
--- a/shell/e-shell-backend.c
+++ b/shell/e-shell-backend.c
@@ -123,22 +123,18 @@ shell_backend_finalize (GObject *object)
static const gchar *
shell_backend_get_config_dir (EShellBackend *shell_backend)
{
+ EShellBackendClass *class;
+
+ class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+
+ /* Determine the user config directory for this backend. */
if (G_UNLIKELY (shell_backend->priv->config_dir == NULL)) {
- const gchar *data_dir;
- gchar *config_dir;
-
- /* Determine the user configuration directory
- * for this backend. */
- data_dir = e_shell_backend_get_data_dir (shell_backend);
- config_dir = g_build_filename (data_dir, "config", NULL);
- shell_backend->priv->config_dir = config_dir;
-
- /* Create the user configuration directory for this backend,
- * which should also create the user data directory. */
- if (g_mkdir_with_parents (config_dir, 0700) != 0)
- g_critical (
- "Cannot create directory %s: %s",
- config_dir, g_strerror (errno));
+ const gchar *user_config_dir;
+
+ user_config_dir = e_get_user_config_dir ();
+ shell_backend->priv->config_dir =
+ g_build_filename (user_config_dir, class->name, NULL);
+ g_mkdir_with_parents (shell_backend->priv->config_dir, 0700);
}
return shell_backend->priv->config_dir;
@@ -149,14 +145,17 @@ shell_backend_get_data_dir (EShellBackend *shell_backend)
{
EShellBackendClass *class;
- g_return_val_if_fail (E_IS_SHELL_BACKEND (shell_backend), NULL);
-
class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
/* Determine the user data directory for this backend. */
- if (G_UNLIKELY (shell_backend->priv->data_dir == NULL))
- shell_backend->priv->data_dir = g_build_filename (
- e_get_user_data_dir (), class->name, NULL);
+ if (G_UNLIKELY (shell_backend->priv->data_dir == NULL)) {
+ const gchar *user_data_dir;
+
+ user_data_dir = e_get_user_data_dir ();
+ shell_backend->priv->data_dir =
+ g_build_filename (user_data_dir, class->name, NULL);
+ g_mkdir_with_parents (shell_backend->priv->data_dir, 0700);
+ }
return shell_backend->priv->data_dir;
}