aboutsummaryrefslogtreecommitdiffstats
path: root/prefs.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-05-25 01:47:46 +0000
committerGuy Harris <guy@alum.mit.edu>2002-05-25 01:47:46 +0000
commitd3604ae33eb8a9269c82386c0f202993f583846d (patch)
tree2d095d84d29984e320dd22b5802d41046b26f7cc /prefs.c
parent16c7726c049f49168d2bd2f0b92e35a6272acd4e (diff)
Don't give ordinal numbers to preferences that aren't displayed.
svn path=/trunk/; revision=5554
Diffstat (limited to 'prefs.c')
-rw-r--r--prefs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/prefs.c b/prefs.c
index 35a672c2d4..336fd1724a 100644
--- a/prefs.c
+++ b/prefs.c
@@ -1,7 +1,7 @@
/* prefs.c
* Routines for handling preferences
*
- * $Id: prefs.c,v 1.82 2002/05/11 18:58:02 guy Exp $
+ * $Id: prefs.c,v 1.83 2002/05/25 01:47:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -260,6 +260,10 @@ prefs_apply_all(void)
/*
* Register a preference in a module's list of preferences.
+ * If it has a title, give it an ordinal number; otherwise, it's a
+ * preference that won't show up in the UI, so it shouldn't get an
+ * ordinal number (the ordinal should be the ordinal in the set of
+ * *visible* preferences).
*/
static pref_t *
register_preference(module_t *module, const char *name, const char *title,
@@ -272,7 +276,10 @@ register_preference(module_t *module, const char *name, const char *title,
preference->name = name;
preference->title = title;
preference->description = description;
- preference->ordinal = module->numprefs;
+ if (title != NULL)
+ preference->ordinal = module->numprefs;
+ else
+ preference->ordinal = -1; /* no ordinal for you */
/*
* Make sure that only lower-case ASCII letters, numbers,
@@ -301,7 +308,8 @@ register_preference(module_t *module, const char *name, const char *title,
* preference.
*/
module->prefs = g_list_append(module->prefs, preference);
- module->numprefs++;
+ if (title != NULL)
+ module->numprefs++;
return preference;
}