From: Christophe CURIS <christophe.cu...@free.fr>

Added a comment to describe each terminal, so it will be easier to maintain
the list in the future; added const attributes to help compiler generate
better code; changed list parsing to use the size of the array instead of
a null pointer mark for better compiled result.

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 util/wmmenugen_misc.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/util/wmmenugen_misc.c b/util/wmmenugen_misc.c
index 21c485c..161a32e 100644
--- a/util/wmmenugen_misc.c
+++ b/util/wmmenugen_misc.c
@@ -26,10 +26,20 @@
 
 #include <WINGs/WUtil.h>
 
-static char *terminals[] = {
-       "x-terminal-emulator", "aterm","eterm", "gnome-terminal", "konsole",
-       "kterm", "mlterm", "rxvt", "mrxvt", "pterm", "xterm", "dtterm",
-       NULL
+
+static const char *const terminals[] = {
+       "x-terminal-emulator", /* Debian wrapper to launch user's prefered X 
terminal */
+       "aterm",    /* AfterStep's X terminal, which provides "transparency" */
+       "eterm",    /* Enlightenment's terminal, designed for eye-candyness 
(and efficiency) */
+       "gnome-terminal",      /* GNOME project's terminal */
+       "konsole",  /* KDE project's terminals */
+       "kterm",    /* a Multi-Lingual Terminal based on xterm, originally by 
Katsuya Sano */
+       "mlterm",   /* a Multi-Lingual Terminal emulator written from scratch */
+       "rxvt",     /* a slimmed-down xterm */
+       "mrxvt",    /* rxvt with support for tabs amongst other things */
+       "pterm",    /* terminal based on PuTTY, a popular SSH client for 
Windows */
+       "xterm",    /* the standard terminal provided by the X Window System */
+       "dtterm"    /* provided by CDE, a frequent Desktop Environment in 
proprietary UNIXs */
 };
 
 /* pick a terminal emulator by finding the first existing entry of `terminals'
@@ -50,7 +60,7 @@ char *find_terminal_emulator(void)
        if (!path)
                return NULL;
 
-       for (i = 0; terminals[i]; i++) {
+       for (i = 0; i < wlengthof(terminals); i++) {
                t = wfindfile(path, terminals[i]);
                if (t) {
                        wfree(t);
-- 
1.9.2


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to