From fb2a6d2e6176dcbfe13589b91a66592738bfc26a Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 8 Aug 2021 09:36:20 +0200 Subject: [PATCH] WPrefs: 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. --- WPrefs.app/Menu.c | 17 ++++++++++++----- WPrefs.app/Paths.c | 12 ++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c index ccf27366..87c7a34d 100644 --- a/WPrefs.app/Menu.c +++ b/WPrefs.app/Menu.c @@ -507,7 +507,7 @@ static void createPanel(_Panel * p) WMSetScrollViewContentView(sview, WMWidgetView(pad)); data = putNewItem(panel, pad, ExternalInfo, _("Debian Menu")); - data->param.pipe.command = "/etc/GNUstep/Defaults/menu.hook"; + data->param.pipe.command = "/etc/" GSUSER_SUBDIR "/" DEFAULTS_SUBDIR "/menu.hook"; data = putNewItem(panel, pad, PipeInfo, _("RedHat Menu")); data->param.pipe.command = "wmconfig --output wmaker"; @@ -518,19 +518,25 @@ static void createPanel(_Panel * p) data = putNewItem(panel, pad, DirectoryInfo, _("Themes")); data->param.directory.command = "setstyle"; data->param.directory.directory = - "/usr/share/WindowMaker/Themes /usr/local/share/WindowMaker/Themes $HOME/GNUstep/Library/WindowMaker/Themes"; + "/usr/share/" PACKAGE_TARNAME "/Themes" + " /usr/local/share/" PACKAGE_TARNAME "/Themes" + " $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Themes"; data->param.directory.stripExt = 1; data = putNewItem(panel, pad, DirectoryInfo, _("Bg Images (scale)")); data->param.directory.command = "wmsetbg -u -s"; data->param.directory.directory = - "/opt/kde2/share/wallpapers /usr/share/WindowMaker/Backgrounds $HOME/GNUstep/Library/WindowMaker/Backgrounds"; + "/opt/kde2/share/wallpapers" + " /usr/share/" PACKAGE_TARNAME "/Backgrounds" + " $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Backgrounds"; data->param.directory.stripExt = 1; data = putNewItem(panel, pad, DirectoryInfo, _("Bg Images (tile)")); data->param.directory.command = "wmsetbg -u -t"; data->param.directory.directory = - "/opt/kde2/share/wallpapers /usr/share/WindowMaker/Backgrounds $HOME/GNUstep/Library/WindowMaker/Backgrounds"; + "/opt/kde2/share/wallpapers" + " /usr/share/" PACKAGE_TARNAME "/Backgrounds" + " $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Backgrounds"; data->param.directory.stripExt = 1; smenu = putNewSubmenu(pad, _("Assorted XTerms")); @@ -619,7 +625,8 @@ static void createPanel(_Panel * p) WMSetLabelText(label, _("Enter the path for a file containing a menu\n" "or a list of directories with the programs you\n" "want to have listed in the menu. Ex:\n" - "~/GNUstep/Library/WindowMaker/menu\n" "or\n" "/usr/bin ~/xbin")); + "~/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/menu\n" + "or\n" "/usr/bin ~/xbin")); WMMapSubwidgets(panel->pathF); diff --git a/WPrefs.app/Paths.c b/WPrefs.app/Paths.c index 6aa7ef57..f48eb484 100644 --- a/WPrefs.app/Paths.c +++ b/WPrefs.app/Paths.c @@ -77,11 +77,11 @@ static void showData(_Panel * panel) if (array) wwarning(_("bad value in option IconPath. Using default path list")); addPathToList(panel->icoL, -1, "~/pixmaps"); - addPathToList(panel->icoL, -1, "~/GNUstep/Library/Icons"); + addPathToList(panel->icoL, -1, "~/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/Icons"); addPathToList(panel->icoL, -1, "/usr/include/X11/pixmaps"); - addPathToList(panel->icoL, -1, "/usr/local/share/WindowMaker/Icons"); - addPathToList(panel->icoL, -1, "/usr/local/share/WindowMaker/Pixmaps"); - addPathToList(panel->icoL, -1, "/usr/share/WindowMaker/Icons"); + addPathToList(panel->icoL, -1, "/usr/local/share/" PACKAGE_TARNAME "/Icons"); + addPathToList(panel->icoL, -1, "/usr/local/share/" PACKAGE_TARNAME "/Pixmaps"); + addPathToList(panel->icoL, -1, "/usr/share/" PACKAGE_TARNAME "/Icons"); } else { for (i = 0; i < WMGetPropListItemCount(array); i++) { val = WMGetFromPLArray(array, i); @@ -94,8 +94,8 @@ static void showData(_Panel * panel) if (array) wwarning(_("bad value in option PixmapPath. Using default path list")); addPathToList(panel->pixL, -1, "~/pixmaps"); - addPathToList(panel->pixL, -1, "~/GNUstep/Library/WindowMaker/Pixmaps"); - addPathToList(panel->pixL, -1, "/usr/local/share/WindowMaker/Pixmaps"); + addPathToList(panel->pixL, -1, "~/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Pixmaps"); + addPathToList(panel->pixL, -1, "/usr/local/share/" PACKAGE_TARNAME "/Pixmaps"); } else { for (i = 0; i < WMGetPropListItemCount(array); i++) { val = WMGetFromPLArray(array, i);