On 12/01/12 00:31, Rodolfo kix Garcia wrote:
> Hi,
>
> if you delete the file ~GNUStep/Defaults/WMRootMenu. Then run WMPrefs
> and go to the Menu Edit tab, it show a dialog about keep the menu or
> discard it. If you discard it, then it show an error:
>
> "Could not open default menu from
> '/home/user/GNUStep/Library/WindowMaker/plmenu"
>
> If we see the code [1], the problem is at WPrefs.app/Menu.c:1424
>
> It happends because uses the "gspath" variable with the user home, but
> plmenu is not copied in the installation. Of course, the file don't
> needs to be copied to the users home, but the function should read it
> form /usr/share/WindowMaker/plmenu (Debian) or
> /usr/local/share/WindowMaker/plmenu (upstream) instead $home.
>
> This variable is set in the configure script, but is stored in any .h/.c
> file to try to read it?
>
> Thanks.
>
> [1]
> static WMPropList *getDefaultMenu(_Panel * panel)
> {
> WMPropList *menu;
> char *menuPath, *gspath;
>
> gspath = wusergnusteppath();
>
> menuPath = wmalloc(strlen(gspath) + 128);
> sprintf(menuPath, "%s/Library/WindowMaker/plmenu", gspath);
>
> menu = WMReadPropListFromFile(menuPath);
>
> if (!menu) {
> char *buffer, *msg;
>
> msg = _("Could not open default menu from '%s'");
>
> Regards,
> kix
Please, can you test this patch.
Thanks a lot,
kix.
>From 5b69f55b340847d0d1f768cb7fab93d5be4e151b Mon Sep 17 00:00:00 2001
From: kix <[email protected]>
Date: Thu, 12 Jan 2012 13:07:05 +0100
Subject: [PATCH] Problem in WPrefs resource menu path
---
WPrefs.app/Makefile.am | 2 +-
WPrefs.app/Menu.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/WPrefs.app/Makefile.am b/WPrefs.app/Makefile.am
index 654457f..3f66428 100644
--- a/WPrefs.app/Makefile.am
+++ b/WPrefs.app/Makefile.am
@@ -40,7 +40,7 @@ WPrefs_SOURCES = \
editmenu.h \
xmodifier.c
-AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\" -DRESOURCE_PATH=\"$(wpdatadir)\"
+AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\"
-DRESOURCE_PATH=\"$(wpdatadir)\" -DWMAKER_RESOURCE_PATH=\"$(pkgdatadir)\"
AM_CFLAGS =
INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs
@HEADER_SEARCH_PATH@
diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c
index 66b24d1..21a9fe1 100644
--- a/WPrefs.app/Menu.c
+++ b/WPrefs.app/Menu.c
@@ -41,6 +41,7 @@ typedef enum {
} InfoType;
#define MAX_SECTION_SIZE 4
+#define PATH_LEN 256
typedef struct _Panel {
WMBox *box;
@@ -1426,10 +1427,10 @@ static WMPropList *getDefaultMenu(_Panel * panel)
WMPropList *menu;
char *menuPath, *gspath;
- gspath = wusergnusteppath();
+ gspath = wstrdup(WMAKER_RESOURCE_PATH);
menuPath = wmalloc(strlen(gspath) + 128);
- sprintf(menuPath, "%s/Library/WindowMaker/plmenu", gspath);
+ sprintf(menuPath, "%s/plmenu", gspath);
menu = WMReadPropListFromFile(menuPath);
@@ -1444,6 +1445,7 @@ static WMPropList *getDefaultMenu(_Panel * panel)
wfree(buffer);
}
+ wfree(gspath);
wfree(menuPath);
return menu;
--
1.7.2.3
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
--
To unsubscribe, send mail to [email protected].