diff --git a/src/commandmodel.cpp b/src/commandmodel.cpp index f647783c1..c4951a1fe 100644 --- a/src/commandmodel.cpp +++ b/src/commandmodel.cpp @@ -4,13 +4,14 @@ #include #include "commandmodel.h" +#include "actionshandler.h" QVariantList CommandModel::filterModel(const QString &filter) { QVariantList result; - for (const QVariant &e : matrix) { + for (const QVariant &e : ActionsHandler::commands()) { auto command = qvariant_cast(e); if (command.command.startsWith(filter)) { result.append(e); @@ -22,11 +23,3 @@ QVariantList CommandModel::filterModel(const QString &filter) return result; } - - -// the help messages are taken from Element (web matrix client, app.element.io) -const QVariantList CommandModel::matrix = { - QVariant::fromValue(Command{"/join", "Join a given room with address"}), - QVariant::fromValue(Command{"/me", "Displays action"}), - -}; diff --git a/src/commandmodel.h b/src/commandmodel.h index 63ef17409..43842d43a 100644 --- a/src/commandmodel.h +++ b/src/commandmodel.h @@ -58,6 +58,4 @@ public: Q_INVOKABLE static QVariantList filterModel(const QString &filter); -private: - static const QVariantList matrix; };