Browse Source

Sort plugins by slug alphabetically

tags/v0.4.0
Andrew Belt 7 years ago
parent
commit
393cc80c17
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      src/plugin.cpp

+ 7
- 0
src/plugin.cpp View File

@@ -100,6 +100,10 @@ static int loadPlugin(std::string path) {
return 0; return 0;
} }


static bool comparePlugins(Plugin *a, Plugin *b) {
return a->slug < b->slug;
}

static void loadPlugins(std::string path) { static void loadPlugins(std::string path) {
DIR *dir = opendir(path.c_str()); DIR *dir = opendir(path.c_str());
if (dir) { if (dir) {
@@ -111,6 +115,9 @@ static void loadPlugins(std::string path) {
} }
closedir(dir); closedir(dir);
} }

// Sort plugins
gPlugins.sort(comparePlugins);
} }


//////////////////// ////////////////////


Loading…
Cancel
Save