about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-06-30 23:58:04 +0100
committerJames Booth <boothj5@gmail.com>2016-06-30 23:58:04 +0100
commit3bd3de036f68b107e9b599f44adcaf0842c708b0 (patch)
tree120cd28b037011e2adbda75aa5f6dc18bcf4d6c1 /src/command
parentbb33522e4d52d13b0814690b63c5d397c1828ed2 (diff)
downloadprofani-tty-3bd3de036f68b107e9b599f44adcaf0842c708b0.tar.gz
Use hash table to store plugins
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_ac.c8
-rw-r--r--src/command/cmd_funcs.c22
2 files changed, 15 insertions, 15 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index a4cd788e..da466b76 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -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) {
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 40944874..70365a60 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -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;
+        }
+
+        GList *curr = plugins;
+        cons_show("Installed plugins:");
+        while (curr) {
+            cons_show("  %s", curr->data);
+            curr = g_list_next(curr);
         }
-        g_slist_free(curr);
+        g_list_free(plugins);
 
         return TRUE;
     }