mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
37 lines
821 B
C++
37 lines
821 B
C++
#include "controllers/ignores/IgnoreController.hpp"
|
|
|
|
#include "Application.hpp"
|
|
#include "controllers/ignores/IgnoreModel.hpp"
|
|
|
|
#include <cassert>
|
|
|
|
namespace chatterino {
|
|
namespace controllers {
|
|
namespace ignores {
|
|
|
|
void IgnoreController::initialize()
|
|
{
|
|
assert(!this->initialized);
|
|
this->initialized = true;
|
|
|
|
for (const IgnorePhrase &phrase : this->ignoresSetting.getValue()) {
|
|
this->phrases.appendItem(phrase);
|
|
}
|
|
|
|
this->phrases.delayedItemsChanged.connect([this] { //
|
|
this->ignoresSetting.setValue(this->phrases.getVector());
|
|
});
|
|
}
|
|
|
|
IgnoreModel *IgnoreController::createModel(QObject *parent)
|
|
{
|
|
IgnoreModel *model = new IgnoreModel(parent);
|
|
model->init(&this->phrases);
|
|
|
|
return model;
|
|
}
|
|
|
|
} // namespace ignores
|
|
} // namespace controllers
|
|
} // namespace chatterino
|