comparison src/plugin.c @ 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 cb77957d644c
children 0692d20d9d81
comparison
equal deleted inserted replaced
12331:56bfd35a5a48 12332:720fb68418d8
309 #else 309 #else
310 return NULL; 310 return NULL;
311 #endif /* !GAIM_PLUGINS */ 311 #endif /* !GAIM_PLUGINS */
312 } 312 }
313 313
314 static gint
315 compare_plugins(gconstpointer a, gconstpointer b)
316 {
317 const GaimPlugin *plugina = a;
318 const GaimPlugin *pluginb = b;
319
320 return strcmp(plugina->info->name, pluginb->info->name);
321 }
322
314 gboolean 323 gboolean
315 gaim_plugin_load(GaimPlugin *plugin) 324 gaim_plugin_load(GaimPlugin *plugin)
316 { 325 {
317 #ifdef GAIM_PLUGINS 326 #ifdef GAIM_PLUGINS
318 GList *dep_list = NULL; 327 GList *dep_list = NULL;
412 if (!loader_info->load(plugin)) 421 if (!loader_info->load(plugin))
413 return FALSE; 422 return FALSE;
414 } 423 }
415 } 424 }
416 425
417 loaded_plugins = g_list_append(loaded_plugins, plugin); 426 loaded_plugins = g_list_insert_sorted(loaded_plugins, plugin, compare_plugins);
418 427
419 plugin->loaded = TRUE; 428 plugin->loaded = TRUE;
420 429
421 /* TODO */ 430 /* TODO */
422 if (load_cb != NULL) 431 if (load_cb != NULL)