diff options
author | James Booth <boothj5@gmail.com> | 2016-07-24 21:35:12 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-07-24 21:49:35 +0100 |
commit | a3a73cf0031fef7b4012b27bc1955c406175f0fe (patch) | |
tree | a9bfba0b9899eff139a9a8e5436468e35d6b7e91 /src/config/theme.c | |
parent | 29452f8f1b8f7a61773905169b3883f1b494c786 (diff) | |
download | profani-tty-a3a73cf0031fef7b4012b27bc1955c406175f0fe.tar.gz |
Move all filepath handling to files.c
Diffstat (limited to 'src/config/theme.c')
-rw-r--r-- | src/config/theme.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/config/theme.c b/src/config/theme.c index 55698ed6..0133b1f6 100644 --- a/src/config/theme.c +++ b/src/config/theme.c @@ -63,7 +63,6 @@ struct colour_string_t { }; static void _load_preferences(void); -static gchar* _get_themes_dir(void); void _theme_list_dir(const gchar *const dir, GSList **result); static GString* _theme_find(const char *const theme_name); static gboolean _theme_load_file(const char *const theme_name); @@ -218,7 +217,7 @@ GSList* theme_list(void) { GSList *result = NULL; - char *themes_dir = _get_themes_dir(); + char *themes_dir = files_get_config_path(DIR_THEMES); _theme_list_dir(themes_dir, &result); free(themes_dir); #ifdef THEMES_PATH @@ -532,16 +531,6 @@ _load_preferences(void) } } -static gchar* -_get_themes_dir(void) -{ - gchar *xdg_config = files_get_xdg_config_home(); - GString *themes_dir = g_string_new(xdg_config); - g_free(xdg_config); - g_string_append(themes_dir, "/profanity/themes"); - return g_string_free(themes_dir, FALSE); -} - void _theme_list_dir(const gchar *const dir, GSList **result) { @@ -560,11 +549,11 @@ static GString* _theme_find(const char *const theme_name) { GString *path = NULL; - gchar *themes_dir = _get_themes_dir(); + char *themes_dir = files_get_config_path(DIR_THEMES); if (themes_dir) { path = g_string_new(themes_dir); - g_free(themes_dir); + free(themes_dir); g_string_append(path, "/"); g_string_append(path, theme_name); if (!g_file_test(path->str, G_FILE_TEST_EXISTS)) { |