diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-05-25 22:01:51 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-05-25 22:02:15 (GMT) |
commit | eef3392134b489fbff7c96046581c987ff7192bd (patch) | |
tree | d9926feb13b8a5008cc0013e7ad0a5adb9c73637 /src/gui | |
parent | 2d16cca046ff80f2be3eea6934dd1dd8f4b807d1 (diff) |
Provided a way to relocate built binaries.
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 } |