From 393cc80c179f908406e373822f8b27a6ba4ec7e0 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 7 Oct 2017 08:56:26 -0400 Subject: [PATCH] Sort plugins by slug alphabetically --- src/plugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugin.cpp b/src/plugin.cpp index 0153e606..b35348a0 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -100,6 +100,10 @@ static int loadPlugin(std::string path) { return 0; } +static bool comparePlugins(Plugin *a, Plugin *b) { + return a->slug < b->slug; +} + static void loadPlugins(std::string path) { DIR *dir = opendir(path.c_str()); if (dir) { @@ -111,6 +115,9 @@ static void loadPlugins(std::string path) { } closedir(dir); } + + // Sort plugins + gPlugins.sort(comparePlugins); } ////////////////////