aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.cpp8
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")) {