Fixed the highlighted user saving the name after chatterino closes #921

This commit is contained in:
apa420 2019-01-19 15:45:25 +01:00
parent ae18f35dfb
commit aca95788d0
2 changed files with 11 additions and 0 deletions

View file

@ -35,6 +35,15 @@ void HighlightController::initialize(Settings &settings, Paths &paths)
this->blacklistedUsers.delayedItemsChanged.connect([this] {
this->blacklistSetting_.setValue(this->blacklistedUsers.getVector());
});
for (const HighlightPhrase &user : this->userSetting_.getValue())
{
this->highlightedUsers.appendItem(user);
}
this->highlightedUsers.delayedItemsChanged.connect([this] { //
this->userSetting_.setValue(this->highlightedUsers.getVector());
});
}
HighlightModel *HighlightController::createModel(QObject *parent)

View file

@ -45,6 +45,8 @@ private:
"/highlighting/highlights"};
ChatterinoSetting<std::vector<HighlightBlacklistUser>> blacklistSetting_ = {
"/highlighting/blacklist"};
ChatterinoSetting<std::vector<HighlightPhrase>> userSetting_ = {
"/highlighting/users"};
};
} // namespace chatterino