this commit is too big
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "singletons/Paths.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "util/CombinePath.hpp"
|
||||
#include "widgets/dialogs/LogsPopup.hpp"
|
||||
|
||||
#include <QApplication>
|
||||
@@ -44,15 +45,14 @@ CommandController::CommandController()
|
||||
this->items.itemRemoved.connect(addFirstMatchToMap);
|
||||
}
|
||||
|
||||
void CommandController::initialize(Application &app)
|
||||
void CommandController::initialize(Settings &, Paths &paths)
|
||||
{
|
||||
this->load();
|
||||
this->load(paths);
|
||||
}
|
||||
|
||||
void CommandController::load()
|
||||
void CommandController::load(Paths &paths)
|
||||
{
|
||||
auto app = getApp();
|
||||
this->filePath_ = app->paths->settingsDirectory + "/commands.txt";
|
||||
this->filePath_ = combinePath(paths.settingsDirectory, "commands.txt");
|
||||
|
||||
QFile textFile(this->filePath_);
|
||||
if (!textFile.open(QIODevice::ReadOnly)) {
|
||||
|
||||
@@ -10,11 +10,14 @@
|
||||
#include "controllers/commands/Command.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class Settings;
|
||||
class Paths;
|
||||
class Channel;
|
||||
|
||||
class CommandModel;
|
||||
|
||||
class CommandController : public Singleton
|
||||
class CommandController final : public Singleton
|
||||
{
|
||||
public:
|
||||
CommandController();
|
||||
@@ -22,7 +25,7 @@ public:
|
||||
QString execCommand(const QString &text, std::shared_ptr<Channel> channel, bool dryRun);
|
||||
QStringList getDefaultTwitchCommandList();
|
||||
|
||||
virtual void initialize(Application &app) override;
|
||||
virtual void initialize(Settings &settings, Paths &paths) override;
|
||||
virtual void save() override;
|
||||
|
||||
CommandModel *createModel(QObject *parent);
|
||||
@@ -30,7 +33,7 @@ public:
|
||||
UnsortedSignalVector<Command> items;
|
||||
|
||||
private:
|
||||
void load();
|
||||
void load(Paths &paths);
|
||||
|
||||
QMap<QString, Command> commandsMap_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user