changeset 12332:720fb68418d8

[gaim-migrate @ 14636] Sort the list of plugins alphabetically by name. Does this slow things down very much? I can't tell. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 05 Dec 2005 02:18:02 +0000
parents 56bfd35a5a48
children 354af9ab4ed3
files src/plugin.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugin.c	Mon Dec 05 01:51:38 2005 +0000
+++ b/src/plugin.c	Mon Dec 05 02:18:02 2005 +0000
@@ -311,6 +311,15 @@
 #endif /* !GAIM_PLUGINS */
 }
 
+static gint
+compare_plugins(gconstpointer a, gconstpointer b)
+{
+	const GaimPlugin *plugina = a;
+	const GaimPlugin *pluginb = b;
+
+	return strcmp(plugina->info->name, pluginb->info->name);
+}
+
 gboolean
 gaim_plugin_load(GaimPlugin *plugin)
 {
@@ -414,7 +423,7 @@
 		}
 	}
 
-	loaded_plugins = g_list_append(loaded_plugins, plugin);
+	loaded_plugins = g_list_insert_sorted(loaded_plugins, plugin, compare_plugins);
 
 	plugin->loaded = TRUE;