diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-23 13:06:51 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-23 13:06:51 +0200 |
commit | 2c569674d4f4a789b8a7d86d1a9541fa90704f5b (patch) | |
tree | 86f7cb53c265713b44cf4c2af987335aa63f284a /src | |
parent | Add ConfigurationEditor plugin (diff) | |
download | smolbote-2c569674d4f4a789b8a7d86d1a9541fa90704f5b.tar.xz |
Sort commands alphabetically
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index ee22753..3de6bfe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,12 +45,16 @@ int main(int argc, char **argv) } QVector<Plugin> plugins = loadPlugins(config->value<QString>("plugins.path").value()); - QHash<QString, std::function<int()>> pluginCommands; + QMap<QString, std::function<int()>> pluginCommands; for(const auto &plugin : plugins) { auto *pluginInterface = qobject_cast<PluginInterface*>(plugin.instance); Q_CHECK_PTR(pluginInterface); - pluginCommands.unite(pluginInterface->commands()); + QHashIterator<QString, std::function<int()>> i(pluginInterface->commands()); + while(i.hasNext()) { + i.next(); + pluginCommands.insert(i.key(), i.value()); + } } if(config->exists("help")) { |