refactor: move ActionHandler::commands to CommandModel::commands
This commit is contained in:
@@ -10,30 +10,14 @@
|
||||
#include <utility>
|
||||
|
||||
struct Command {
|
||||
Command(QString p, QString a, QString h)
|
||||
: command(std::move(std::move(p)))
|
||||
, parameter(std::move(std::move(a)))
|
||||
, help(std::move(std::move(h)))
|
||||
Command(const QString &p, const QString &a, const QString &h)
|
||||
: command(p)
|
||||
, parameter(a)
|
||||
, help(h)
|
||||
{
|
||||
}
|
||||
Command() = default;
|
||||
|
||||
friend QDataStream &operator<<(QDataStream &arch, const Command &object)
|
||||
{
|
||||
arch << object.command;
|
||||
arch << object.parameter;
|
||||
arch << object.help;
|
||||
return arch;
|
||||
}
|
||||
|
||||
friend QDataStream &operator>>(QDataStream &arch, Command &object)
|
||||
{
|
||||
arch >> object.command;
|
||||
arch >> object.parameter;
|
||||
arch >> object.help;
|
||||
return arch;
|
||||
}
|
||||
|
||||
QString command;
|
||||
QString parameter;
|
||||
QString help;
|
||||
@@ -42,6 +26,7 @@ Q_GADGET
|
||||
Q_PROPERTY(QString command MEMBER command)
|
||||
Q_PROPERTY(QString parameter MEMBER parameter)
|
||||
Q_PROPERTY(QString help MEMBER help)
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(Command)
|
||||
@@ -57,5 +42,5 @@ public:
|
||||
}
|
||||
|
||||
Q_INVOKABLE QVariantList filterModel(const QString &filter);
|
||||
|
||||
static QVariantList commands();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user