Merge pull request #922 from apa420/apa-saving-highlighted-users

Fixed the highlighted user saving the name after chatterino closes
This commit is contained in:
pajlada 2019-01-22 22:24:48 +01:00 committed by GitHub
commit 5311356bed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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->blacklistedUsers.delayedItemsChanged.connect([this] {
this->blacklistSetting_.setValue(this->blacklistedUsers.getVector()); 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) HighlightModel *HighlightController::createModel(QObject *parent)

View file

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