diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/core/theme.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/gui/core/theme.c b/src/gui/core/theme.c index 578bf9b..1345717 100644 --- a/src/gui/core/theme.c +++ b/src/gui/core/theme.c @@ -43,6 +43,7 @@ #include "../../common/extstr.h" #include "../../common/xdg.h" #include "../../core/logs.h" +#include "../../core/paths.h" @@ -50,18 +51,6 @@ static void look_for_editor_themes(const char *); -/* Répertoires de recherche */ -static const char *_themes_directories[] = { - -#ifndef DISCARD_LOCAL - PACKAGE_SOURCE_DIR G_DIR_SEPARATOR_S "themes", -#else - THEMES_DIR, -#endif - NULL - -}; - /* Liste de thèmes utilisables */ static GEditorTheme **_themes = NULL; static size_t _theme_count = 0; @@ -84,7 +73,9 @@ void load_all_themes(void) { char *suffix; /* Fin du répertoire personnel */ char *owndir; /* Thèmes personnels ? */ - const char **iter; /* Boucle de parcours */ +#ifdef DISCARD_LOCAL + char *edir; /* Répertoire de base effectif */ +#endif /* Répertoire de l'utilisateur en premier ! */ @@ -104,8 +95,15 @@ void load_all_themes(void) /* Parcours des autres répertoires classiques au besoin */ - for (iter = _themes_directories; *iter != NULL; iter++) - look_for_editor_themes(*iter); +#ifndef DISCARD_LOCAL + look_for_editor_themes(PACKAGE_SOURCE_DIR G_DIR_SEPARATOR_S "themes"); +#else + + edir = get_effective_directory(THEMES_DIR); + look_for_editor_themes(edir); + free(edir); + +#endif } |