From 2c569674d4f4a789b8a7d86d1a9541fa90704f5b Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sat, 23 Jun 2018 13:06:51 +0200 Subject: Sort commands alphabetically --- src/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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 plugins = loadPlugins(config->value("plugins.path").value()); - QHash> pluginCommands; + QMap> pluginCommands; for(const auto &plugin : plugins) { auto *pluginInterface = qobject_cast(plugin.instance); Q_CHECK_PTR(pluginInterface); - pluginCommands.unite(pluginInterface->commands()); + QHashIterator> i(pluginInterface->commands()); + while(i.hasNext()) { + i.next(); + pluginCommands.insert(i.key(), i.value()); + } } if(config->exists("help")) { -- cgit v1.2.1