mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 21:16:21 +00:00
Use hash table to store plugins
This commit is contained in:
@@ -1894,13 +1894,13 @@ _plugins_autocomplete(ProfWin *window, const char *const input)
|
||||
if (strncmp(input, "/plugins unload ", 16) == 0) {
|
||||
if (plugins_unload_ac == NULL) {
|
||||
plugins_unload_ac = autocomplete_new();
|
||||
GSList *plugins = plugins_loaded_list();
|
||||
GSList *curr = plugins;
|
||||
GList *plugins = plugins_loaded_list();
|
||||
GList *curr = plugins;
|
||||
while (curr) {
|
||||
autocomplete_add(plugins_unload_ac, curr->data);
|
||||
curr = g_slist_next(curr);
|
||||
curr = g_list_next(curr);
|
||||
}
|
||||
g_slist_free(plugins);
|
||||
g_list_free(plugins);
|
||||
}
|
||||
result = autocomplete_param_with_ac(input, "/plugins unload", plugins_unload_ac, TRUE);
|
||||
if (result) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user