1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 12:00:31 +01:00

Utils: Use the constants added in config-paths.h for paths

Replace hard-coded directory names by the constants that have been
previously added to the common header.
This commit is contained in:
Christophe CURIS
2021-08-08 09:36:21 +02:00
committed by Carlos R. Mafra
parent fb2a6d2e61
commit 9f9ef6417e
2 changed files with 12 additions and 10 deletions

View File

@@ -55,6 +55,9 @@
#include "../src/wconfig.h"
#define THEME_SUBPATH "/" PACKAGE_TARNAME "/Themes/"
#define THEME_EXTDIR ".themed/"
/* table of style related options */
static char *options[] = {
"TitleJustify",
@@ -137,7 +140,9 @@ static noreturn void print_help(int print_usage, int exitval)
{
printf("Usage: %s [-t] [-p] [-h] [-v] [file]\n", prog_name);
if (print_usage) {
puts("Retrieves style/theme configuration and outputs to ~/GNUstep/Library/WindowMaker/Themes/file.themed/style or to stdout");
puts("Retrieves style/theme configuration and outputs to "
"~/" GSUSER_SUBDIR "/" USERDATA_SUBDIR THEME_SUBPATH "file" THEME_EXTDIR "style"
" or to stdout");
puts("");
puts(" -h, --help display this help and exit");
puts(" -v, --version output version information and exit");
@@ -175,9 +180,6 @@ static void findCopyFile(const char *dir, const char *file)
wfree(fullPath);
}
#define THEME_SUBPATH "/" PACKAGE_TARNAME "/Themes/"
#define THEME_EXTDIR ".themed/"
static void makeThemePack(WMPropList * style, const char *themeName)
{
WMPropList *keys;

View File

@@ -44,9 +44,9 @@ int main(int argc, char *argv[])
char *tmp, *theme_paths, *style_paths, *icon_paths;
tmp = wstrconcat("-noext ", PKGDATADIR);
theme_paths = wstrconcat(tmp, "/Themes $HOME/GNUstep/Library/WindowMaker/Themes WITH setstyle");
style_paths = wstrconcat(tmp, "/Styles $HOME/GNUstep/Library/WindowMaker/Styles WITH setstyle");
icon_paths = wstrconcat(tmp, "/IconSets $HOME/GNUstep/Library/WindowMaker/IconSets WITH seticons");
theme_paths = wstrconcat(tmp, "/Themes $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Themes WITH setstyle");
style_paths = wstrconcat(tmp, "/Styles $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Styles WITH setstyle");
icon_paths = wstrconcat(tmp, "/IconSets $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/IconSets WITH seticons");
struct option longopts[] = {
{ "version", no_argument, NULL, 'v' },
@@ -245,7 +245,7 @@ int main(int argc, char *argv[])
L3Menu = WMCreatePLArray(
WMCreatePLString(_("Images")),
WMCreatePLString("OPEN_MENU"),
WMCreatePLString("-noext $HOME/GNUstep/Library/WindowMaker/Backgrounds WITH wmsetbg -u -t"),
WMCreatePLString("-noext $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Backgrounds WITH wmsetbg -u -t"),
NULL
);
WMAddToPLArray(L2Menu, L3Menu);
@@ -265,7 +265,7 @@ int main(int argc, char *argv[])
L2Menu = WMCreatePLArray(
WMCreatePLString(_("Save IconSet")),
WMCreatePLString("SHEXEC"),
WMCreatePLString("geticonset $HOME/GNUstep/Library/WindowMaker/IconSets/"
WMCreatePLString("geticonset $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/IconSets/"
"\"%a(IconSet name,Name to save icon set as)\""),
NULL
);
@@ -503,7 +503,7 @@ noreturn void print_help(int print_usage, int exitval)
{
printf("Usage: %s [-h] [-v]\n", prog_name);
if (print_usage) {
puts("Writes a menu structure usable as ~/GNUstep/Defaults/WMRootMenu to stdout");
puts("Writes a menu structure usable as ~/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/WMRootMenu to stdout");
puts("");
puts(" -h, --help display this help and exit");
puts(" -v, --version output version information and exit");