summaryrefslogtreecommitdiff
path: root/src/file-utils.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-19 15:20:34 +0100
committerinfirit <[email protected]>2014-11-19 15:44:09 +0100
commit10d6972d37355198a63309142ae9875fdcc222f6 (patch)
treeeb447d06bb1a668f241c44c07895622558f3ab5b /src/file-utils.c
parent5591da29a5027de4f8ec5c967d2d0ff6ba579af0 (diff)
downloadengrampa-10d6972d37355198a63309142ae9875fdcc222f6.tar.bz2
engrampa-10d6972d37355198a63309142ae9875fdcc222f6.tar.xz
use g_get_user_config_dir instead of using .config/mate
Also provide an automatic migration mechanism. Based on FR commit: 7fd220a834f16b260da8f5ddc1250c43b9dbefd8 From: Paolo Bacchilega <[email protected]>
Diffstat (limited to 'src/file-utils.c')
-rw-r--r--src/file-utils.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/file-utils.c b/src/file-utils.c
index 3b33480..7e1f170 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -1232,6 +1232,29 @@ get_home_relative_file (const char *partial_uri)
}
+GFile *
+get_user_config_subdirectory (const char *child_name,
+ gboolean create_child)
+{
+ char *full_path;
+ GFile *file;
+ GError *error = NULL;
+
+ full_path = g_strconcat (g_get_user_config_dir (), "/", child_name, NULL);
+ file = g_file_new_for_path (full_path);
+ g_free (full_path);
+
+ if (create_child && ! make_directory_tree (file, 0700, &error)) {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ g_object_unref (file);
+ file = NULL;
+ }
+
+ return file;
+}
+
+
const char *
remove_host_from_uri (const char *uri)
{