From aca95788d0820853e7bfd101adcd89d72e862d01 Mon Sep 17 00:00:00 2001 From: apa420 Date: Sat, 19 Jan 2019 15:45:25 +0100 Subject: [PATCH] Fixed the highlighted user saving the name after chatterino closes #921 --- src/controllers/highlights/HighlightController.cpp | 9 +++++++++ src/controllers/highlights/HighlightController.hpp | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/controllers/highlights/HighlightController.cpp b/src/controllers/highlights/HighlightController.cpp index 436f1b6b5..36caa4925 100644 --- a/src/controllers/highlights/HighlightController.cpp +++ b/src/controllers/highlights/HighlightController.cpp @@ -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) diff --git a/src/controllers/highlights/HighlightController.hpp b/src/controllers/highlights/HighlightController.hpp index 963f23aaa..5315e2b65 100644 --- a/src/controllers/highlights/HighlightController.hpp +++ b/src/controllers/highlights/HighlightController.hpp @@ -45,6 +45,8 @@ private: "/highlighting/highlights"}; ChatterinoSetting> blacklistSetting_ = { "/highlighting/blacklist"}; + ChatterinoSetting> userSetting_ = { + "/highlighting/users"}; }; } // namespace chatterino