From b03c39cfd76cc7543527785f40d524b43c99a9d6 Mon Sep 17 00:00:00 2001 From: datguy Date: Mon, 2 Jul 2018 19:53:51 +0300 Subject: [PATCH] Fix bug with 'disabled users' textbox Fix 553 --- src/widgets/settingspages/HighlightingPage.cpp | 17 +++++------------ src/widgets/settingspages/HighlightingPage.hpp | 3 --- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/widgets/settingspages/HighlightingPage.cpp b/src/widgets/settingspages/HighlightingPage.cpp index 03002a3e5..d0cce5a05 100644 --- a/src/widgets/settingspages/HighlightingPage.cpp +++ b/src/widgets/settingspages/HighlightingPage.cpp @@ -67,15 +67,11 @@ HighlightingPage::HighlightingPage() { auto text = disabledUsers.emplace().getElement(); - QObject::connect(text, &QTextEdit::textChanged, this, - [this] { this->disabledUsersChangedTimer.start(200); }); - - QObject::connect( - &this->disabledUsersChangedTimer, &QTimer::timeout, this, [text, app]() { - QStringList list = text->toPlainText().split("\n", QString::SkipEmptyParts); - list.removeDuplicates(); - app->settings->highlightUserBlacklist = list.join("\n") + "\n"; - }); + QObject::connect(text, &QTextEdit::textChanged, this, [text, app] { + QStringList list = text->toPlainText().split("\n", QString::SkipEmptyParts); + list.removeDuplicates(); + app->settings->highlightUserBlacklist = list.join("\n") + "\n"; + }); app->settings->highlightUserBlacklist.connect([=](const QString &str, auto) { text->setPlainText(str); // @@ -98,9 +94,6 @@ HighlightingPage::HighlightingPage() layout.append(createCheckBox(ALWAYS_PLAY, app->settings->highlightAlwaysPlaySound)); } - - // ---- misc - this->disabledUsersChangedTimer.setSingleShot(true); } } // namespace chatterino diff --git a/src/widgets/settingspages/HighlightingPage.hpp b/src/widgets/settingspages/HighlightingPage.hpp index 80152db9e..f3751ff5b 100644 --- a/src/widgets/settingspages/HighlightingPage.hpp +++ b/src/widgets/settingspages/HighlightingPage.hpp @@ -14,9 +14,6 @@ class HighlightingPage : public SettingsPage { public: HighlightingPage(); - -private: - QTimer disabledUsersChangedTimer; }; } // namespace chatterino