mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
wmaker: removed dead code related to 'GLOBAL_SUBMENU_FILE'
There was the possibility to include a global sub-menu to the root menu using a dedicated file, but this does not look like it is really useful as this root menu is already defined by a user file, and the root menu is already specific enough that it does not need anything more 'global'. Furthermore, the variable enabling this feature (GLOBAL_SUBMENU_FILE) is not defined anywhere (neither from "configure", nor in "wconfig.h", ...) and is also not documented at all. Considering it was introduced a very long time ago (1999!) and was not touched anymore, this patch removes the dead code associated with it. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
af2aba6f95
commit
edc12fad9f
@@ -66,7 +66,7 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name);
|
|||||||
static WMenu *readPLMenuPipe(WScreen * scr, char **file_name);
|
static WMenu *readPLMenuPipe(WScreen * scr, char **file_name);
|
||||||
static WMenu *readMenuFile(WScreen *scr, const char *file_name);
|
static WMenu *readMenuFile(WScreen *scr, const char *file_name);
|
||||||
static WMenu *readMenuDirectory(WScreen *scr, const char *title, char **file_name, const char *command);
|
static WMenu *readMenuDirectory(WScreen *scr, const char *title, char **file_name, const char *command);
|
||||||
static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool includeGlobals);
|
static WMenu *configureMenu(WScreen *scr, WMPropList *definition);
|
||||||
static void menu_parser_register_macros(WMenuParser parser);
|
static void menu_parser_register_macros(WMenuParser parser);
|
||||||
|
|
||||||
typedef struct Shortcut {
|
typedef struct Shortcut {
|
||||||
@@ -602,7 +602,7 @@ static WMenu *constructPLMenu(WScreen *screen, const char *path)
|
|||||||
if (!pl)
|
if (!pl)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
menu = configureMenu(screen, pl, False);
|
menu = configureMenu(screen, pl);
|
||||||
|
|
||||||
WMReleasePropList(pl);
|
WMReleasePropList(pl);
|
||||||
|
|
||||||
@@ -1147,7 +1147,7 @@ static WMenu *readPLMenuPipe(WScreen * scr, char **file_name)
|
|||||||
if (!plist)
|
if (!plist)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
menu = configureMenu(scr, plist, False);
|
menu = configureMenu(scr, plist);
|
||||||
|
|
||||||
WMReleasePropList(plist);
|
WMReleasePropList(plist);
|
||||||
|
|
||||||
@@ -1462,7 +1462,7 @@ static WMenu *makeDefaultMenu(WScreen * scr)
|
|||||||
*
|
*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool includeGlobals)
|
static WMenu *configureMenu(WScreen *scr, WMPropList *definition)
|
||||||
{
|
{
|
||||||
WMenu *menu = NULL;
|
WMenu *menu = NULL;
|
||||||
WMPropList *elem;
|
WMPropList *elem;
|
||||||
@@ -1540,23 +1540,6 @@ static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool include
|
|||||||
menu = wMenuCreate(scr, M_(mtitle), False);
|
menu = wMenuCreate(scr, M_(mtitle), False);
|
||||||
menu->on_destroy = removeShortcutsForMenu;
|
menu->on_destroy = removeShortcutsForMenu;
|
||||||
|
|
||||||
#ifdef GLOBAL_SUBMENU_FILE
|
|
||||||
if (includeGlobals) {
|
|
||||||
WMenu *submenu;
|
|
||||||
WMenuEntry *mentry;
|
|
||||||
|
|
||||||
submenu = readMenuFile(scr, GLOBAL_SUBMENU_FILE);
|
|
||||||
|
|
||||||
if (submenu) {
|
|
||||||
mentry = wMenuAddCallback(menu, submenu->frame->title, NULL, NULL);
|
|
||||||
wMenuEntrySetCascade(menu, mentry, submenu);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/* Parameter not used, but tell the compiler that it is ok */
|
|
||||||
(void) includeGlobals;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 1; i < count; i++) {
|
for (i = 1; i < count; i++) {
|
||||||
elem = WMGetFromPLArray(definition, i);
|
elem = WMGetFromPLArray(definition, i);
|
||||||
#if 0
|
#if 0
|
||||||
@@ -1575,7 +1558,7 @@ static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool include
|
|||||||
WMenuEntry *mentry;
|
WMenuEntry *mentry;
|
||||||
|
|
||||||
/* submenu */
|
/* submenu */
|
||||||
submenu = configureMenu(scr, elem, True);
|
submenu = configureMenu(scr, elem);
|
||||||
if (submenu) {
|
if (submenu) {
|
||||||
mentry = wMenuAddCallback(menu, submenu->frame->title, NULL, NULL);
|
mentry = wMenuAddCallback(menu, submenu->frame->title, NULL, NULL);
|
||||||
wMenuEntrySetCascade(menu, mentry, submenu);
|
wMenuEntrySetCascade(menu, mentry, submenu);
|
||||||
@@ -1670,14 +1653,14 @@ void OpenRootMenu(WScreen * scr, int x, int y, int keyboard)
|
|||||||
if (definition) {
|
if (definition) {
|
||||||
if (WMIsPLArray(definition)) {
|
if (WMIsPLArray(definition)) {
|
||||||
if (!scr->root_menu || w_global.domain.root_menu->timestamp > scr->root_menu->timestamp) {
|
if (!scr->root_menu || w_global.domain.root_menu->timestamp > scr->root_menu->timestamp) {
|
||||||
menu = configureMenu(scr, definition, True);
|
menu = configureMenu(scr, definition);
|
||||||
if (menu)
|
if (menu)
|
||||||
menu->timestamp = w_global.domain.root_menu->timestamp;
|
menu->timestamp = w_global.domain.root_menu->timestamp;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
menu = NULL;
|
menu = NULL;
|
||||||
} else {
|
} else {
|
||||||
menu = configureMenu(scr, definition, True);
|
menu = configureMenu(scr, definition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user