# HG changeset patch # User Mark Doliner # Date 1133749082 0 # Node ID 720fb68418d8f304b9710d742f1fd8e787d6e650 # Parent 56bfd35a5a4840285e952a89ca1c5a5091332cd5 [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 diff -r 56bfd35a5a48 -r 720fb68418d8 src/plugin.c --- 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;