1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-24 16:25:46 +01:00

Use wuserdatapath() everytime it is applicable

Replace calls to wusergnusteppath() which just append "/Library" by calls
to wuserdatapath().
Take opportunity to replace hardcoded "/WindowMaker" directories with
the existing PACKAGE_TARNAME macro (which comes from autotools).

The choice of 'TARNAME' is because it meant to be used in filename, thus
less likely to have problematic characters than PACKAGE_NAME (meant for
display purpose) and PACKAGE which is there for historical reason.
This commit is contained in:
John D Pell
2021-08-08 09:36:18 +02:00
committed by Carlos R. Mafra
parent 1e45ff2305
commit bd38778bef
6 changed files with 16 additions and 18 deletions

View File

@@ -175,7 +175,7 @@ static void findCopyFile(const char *dir, const char *file)
wfree(fullPath);
}
#define THEME_SUBPATH "/Library/WindowMaker/Themes/"
#define THEME_SUBPATH "/" PACKAGE_TARNAME "/Themes/"
#define THEME_EXTDIR ".themed/"
static void makeThemePack(WMPropList * style, const char *themeName)
@@ -186,16 +186,16 @@ static void makeThemePack(WMPropList * style, const char *themeName)
int i;
size_t themeNameLen;
char *themeDir;
const char *user_base;
const char *user_library;
user_base = wusergnusteppath();
if (user_base == NULL)
user_library = wuserdatapath();
if (user_library == NULL)
return;
themeNameLen = strlen(user_base) + sizeof(THEME_SUBPATH) + strlen(themeName) + sizeof(THEME_EXTDIR) + 1;
themeNameLen = strlen(user_library) + sizeof(THEME_SUBPATH) + strlen(themeName) + sizeof(THEME_EXTDIR) + 1;
themeDir = wmalloc(themeNameLen);
snprintf(themeDir, themeNameLen,
"%s" THEME_SUBPATH "%s" THEME_EXTDIR,
user_base, themeName);
user_library, themeName);
ThemePath = themeDir;
if (!wmkdirhier(themeDir)) {