[gedit] gedit-dirs: add get_user_data_dir()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] gedit-dirs: add get_user_data_dir()
- Date: Thu, 14 Nov 2019 16:22:17 +0000 (UTC)
commit b1c7c1b2cfd1eb0f0a98bbb34ec3f8b66cce9b6f
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Nov 14 12:10:15 2019 +0100
gedit-dirs: add get_user_data_dir()
It will be used for tepl_metadata_manager_init().
gedit/gedit-dirs.c | 17 +++++++++++++----
gedit/gedit-dirs.h | 2 ++
2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/gedit/gedit-dirs.c b/gedit/gedit-dirs.c
index 5855f4af2..b76d4831c 100644
--- a/gedit/gedit-dirs.c
+++ b/gedit/gedit-dirs.c
@@ -27,6 +27,7 @@
#endif
static gchar *user_config_dir = NULL;
+static gchar *user_data_dir = NULL;
static gchar *user_styles_dir = NULL;
static gchar *user_plugins_dir = NULL;
static gchar *gedit_locale_dir = NULL;
@@ -97,12 +98,13 @@ gedit_dirs_init ()
user_config_dir = g_build_filename (g_get_user_config_dir (),
"gedit",
NULL);
- user_styles_dir = g_build_filename (g_get_user_data_dir (),
- "gedit",
+ user_data_dir = g_build_filename (g_get_user_data_dir (),
+ "gedit",
+ NULL);
+ user_styles_dir = g_build_filename (user_data_dir,
"styles",
NULL);
- user_plugins_dir = g_build_filename (g_get_user_data_dir (),
- "gedit",
+ user_plugins_dir = g_build_filename (user_data_dir,
"plugins",
NULL);
gedit_plugins_dir = g_build_filename (gedit_lib_dir,
@@ -114,6 +116,7 @@ void
gedit_dirs_shutdown ()
{
g_free (user_config_dir);
+ g_free (user_data_dir);
g_free (user_styles_dir);
g_free (user_plugins_dir);
g_free (gedit_locale_dir);
@@ -128,6 +131,12 @@ gedit_dirs_get_user_config_dir (void)
return user_config_dir;
}
+const gchar *
+gedit_dirs_get_user_data_dir (void)
+{
+ return user_data_dir;
+}
+
const gchar *
gedit_dirs_get_user_styles_dir (void)
{
diff --git a/gedit/gedit-dirs.h b/gedit/gedit-dirs.h
index bd51e93fe..3fc7ab581 100644
--- a/gedit/gedit-dirs.h
+++ b/gedit/gedit-dirs.h
@@ -34,6 +34,8 @@ void gedit_dirs_shutdown (void);
const gchar *gedit_dirs_get_user_config_dir (void);
+const gchar *gedit_dirs_get_user_data_dir (void);
+
const gchar *gedit_dirs_get_user_styles_dir (void);
const gchar *gedit_dirs_get_user_plugins_dir (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]