Use hash table to store plugins

This commit is contained in:
James Booth
2016-06-30 23:58:04 +01:00
parent bb33522e4d
commit 3bd3de036f
4 changed files with 143 additions and 109 deletions

View File

@@ -6053,19 +6053,19 @@ cmd_plugins(ProfWin *window, const char *const command, gchar **args)
return TRUE;
} else {
GSList *plugins = plugins_get_list();
GSList *curr = plugins;
if (curr == NULL) {
GList *plugins = plugins_loaded_list();
if (plugins == NULL) {
cons_show("No plugins installed.");
} else {
cons_show("Installed plugins:");
while (curr) {
ProfPlugin *plugin = curr->data;
cons_show(" %s", plugin->name);
curr = g_slist_next(curr);
}
return TRUE;
}
g_slist_free(curr);
GList *curr = plugins;
cons_show("Installed plugins:");
while (curr) {
cons_show(" %s", curr->data);
curr = g_list_next(curr);
}
g_list_free(plugins);
return TRUE;
}