diff options
-rw-r--r-- | gedit/gedit-dirs.c | 11 | ||||
-rw-r--r-- | gedit/gedit-dirs.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gedit/gedit-dirs.c b/gedit/gedit-dirs.c index 81f32c287..5e0a4f7be 100644 --- a/gedit/gedit-dirs.c +++ b/gedit/gedit-dirs.c @@ -26,6 +26,7 @@ #include <gtkosxapplication.h> #endif +static gchar *user_cache_dir = NULL; static gchar *user_config_dir = NULL; static gchar *user_data_dir = NULL; static gchar *user_styles_dir = NULL; @@ -95,6 +96,9 @@ gedit_dirs_init () NULL); } + user_cache_dir = g_build_filename (g_get_user_cache_dir (), + "gedit", + NULL); user_config_dir = g_build_filename (g_get_user_config_dir (), "gedit", NULL); @@ -115,6 +119,7 @@ gedit_dirs_init () void gedit_dirs_shutdown () { + g_clear_pointer (&user_cache_dir, g_free); g_clear_pointer (&user_config_dir, g_free); g_clear_pointer (&user_data_dir, g_free); g_clear_pointer (&user_styles_dir, g_free); @@ -126,6 +131,12 @@ gedit_dirs_shutdown () } const gchar * +gedit_dirs_get_user_cache_dir (void) +{ + return user_cache_dir; +} + +const gchar * gedit_dirs_get_user_config_dir (void) { return user_config_dir; diff --git a/gedit/gedit-dirs.h b/gedit/gedit-dirs.h index 3fc7ab581..0df8b95fb 100644 --- a/gedit/gedit-dirs.h +++ b/gedit/gedit-dirs.h @@ -32,6 +32,8 @@ void gedit_dirs_init (void); void gedit_dirs_shutdown (void); +const gchar *gedit_dirs_get_user_cache_dir (void); + const gchar *gedit_dirs_get_user_config_dir (void); const gchar *gedit_dirs_get_user_data_dir (void); |