2018-06-28 19:38:57 +02:00
|
|
|
#include "ModerationActions.hpp"
|
|
|
|
|
|
|
|
#include "Application.hpp"
|
2018-07-03 14:59:18 +02:00
|
|
|
#include "controllers/moderationactions/ModerationActionModel.hpp"
|
2018-06-28 19:46:45 +02:00
|
|
|
#include "singletons/Settings.hpp"
|
2018-06-28 19:38:57 +02:00
|
|
|
|
|
|
|
#include <QRegularExpression>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
ModerationActions::ModerationActions()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ModerationActions::initialize()
|
|
|
|
{
|
2018-07-06 19:23:47 +02:00
|
|
|
assert(!this->initialized_);
|
|
|
|
this->initialized_ = true;
|
2018-06-28 19:38:57 +02:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
for (auto &val : this->setting_.getValue()) {
|
2018-06-28 19:38:57 +02:00
|
|
|
this->items.insertItem(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
this->items.delayedItemsChanged.connect([this] { //
|
2018-07-06 19:23:47 +02:00
|
|
|
this->setting_.setValue(this->items.getVector());
|
2018-06-28 19:38:57 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-03 14:59:18 +02:00
|
|
|
ModerationActionModel *ModerationActions::createModel(QObject *parent)
|
|
|
|
{
|
|
|
|
ModerationActionModel *model = new ModerationActionModel(parent);
|
|
|
|
model->init(&this->items);
|
|
|
|
|
|
|
|
return model;
|
|
|
|
}
|
|
|
|
|
2018-06-28 19:38:57 +02:00
|
|
|
} // namespace chatterino
|