aboutsummaryrefslogtreecommitdiffstats
path: root/prefs.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-10-21 17:30:50 +0000
committerGuy Harris <guy@alum.mit.edu>2001-10-21 17:30:50 +0000
commit10b0659ca0513db8021d1b81f9684bcfb6984323 (patch)
tree9f856f985d44ca523bb8e4c64298a8dbb0771412 /prefs.c
parente4dbc04bf08951628e14d0a9dd887e859d826dd7 (diff)
Keep the list of modules with preferences sorted by the module name, in
dictionary order (case-insensitive), so that they show up in order in the "Preferences" dialog box. svn path=/trunk/; revision=4052
Diffstat (limited to 'prefs.c')
-rw-r--r--prefs.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/prefs.c b/prefs.c
index 04d64f3ae1..e28aa5a676 100644
--- a/prefs.c
+++ b/prefs.c
@@ -1,7 +1,7 @@
/* prefs.c
* Routines for handling preferences
*
- * $Id: prefs.c,v 1.63 2001/10/16 07:35:11 guy Exp $
+ * $Id: prefs.c,v 1.64 2001/10/21 17:30:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -98,6 +98,15 @@ gchar *gui_hex_dump_highlight_style_text[] =
*/
static GList *modules;
+static gint
+module_compare_name(gconstpointer p1_arg, gconstpointer p2_arg)
+{
+ const module_t *p1 = p1_arg;
+ const module_t *p2 = p2_arg;
+
+ return g_strcasecmp(p1->name, p2->name);
+}
+
/*
* Register a module that will have preferences.
* Specify the name used for the module in the preferences file, the
@@ -118,7 +127,7 @@ prefs_register_module(const char *name, const char *title,
module->numprefs = 0;
module->prefs_changed = FALSE;
- modules = g_list_append(modules, module);
+ modules = g_list_insert_sorted(modules, module, module_compare_name);
return module;
}