started to refactor Application
This commit is contained in:
@@ -43,6 +43,11 @@ CommandController::CommandController()
|
||||
this->items.itemRemoved.connect(addFirstMatchToMap);
|
||||
}
|
||||
|
||||
void CommandController::initialize(Application &app)
|
||||
{
|
||||
this->load();
|
||||
}
|
||||
|
||||
void CommandController::load()
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/Singleton.hpp"
|
||||
|
||||
#include <QMap>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
@@ -12,7 +14,7 @@ class Channel;
|
||||
|
||||
class CommandModel;
|
||||
|
||||
class CommandController
|
||||
class CommandController : public Singleton
|
||||
{
|
||||
public:
|
||||
CommandController();
|
||||
@@ -20,14 +22,16 @@ public:
|
||||
QString execCommand(const QString &text, std::shared_ptr<Channel> channel, bool dryRun);
|
||||
QStringList getDefaultTwitchCommandList();
|
||||
|
||||
void load();
|
||||
void save();
|
||||
virtual void initialize(Application &app) override;
|
||||
virtual void save() override;
|
||||
|
||||
CommandModel *createModel(QObject *parent);
|
||||
|
||||
UnsortedSignalVector<Command> items;
|
||||
|
||||
private:
|
||||
void load();
|
||||
|
||||
QMap<QString, Command> commandsMap_;
|
||||
|
||||
std::mutex mutex_;
|
||||
|
||||
Reference in New Issue
Block a user