Fix bug with 'disabled users' textbox

Fix 553
This commit is contained in:
datguy 2018-07-02 19:53:51 +03:00
parent 978931bcfc
commit b03c39cfd7
2 changed files with 5 additions and 15 deletions

View file

@ -67,11 +67,7 @@ HighlightingPage::HighlightingPage()
{ {
auto text = disabledUsers.emplace<QTextEdit>().getElement(); auto text = disabledUsers.emplace<QTextEdit>().getElement();
QObject::connect(text, &QTextEdit::textChanged, this, QObject::connect(text, &QTextEdit::textChanged, this, [text, app] {
[this] { this->disabledUsersChangedTimer.start(200); });
QObject::connect(
&this->disabledUsersChangedTimer, &QTimer::timeout, this, [text, app]() {
QStringList list = text->toPlainText().split("\n", QString::SkipEmptyParts); QStringList list = text->toPlainText().split("\n", QString::SkipEmptyParts);
list.removeDuplicates(); list.removeDuplicates();
app->settings->highlightUserBlacklist = list.join("\n") + "\n"; app->settings->highlightUserBlacklist = list.join("\n") + "\n";
@ -98,9 +94,6 @@ HighlightingPage::HighlightingPage()
layout.append(createCheckBox(ALWAYS_PLAY, app->settings->highlightAlwaysPlaySound)); layout.append(createCheckBox(ALWAYS_PLAY, app->settings->highlightAlwaysPlaySound));
} }
// ---- misc
this->disabledUsersChangedTimer.setSingleShot(true);
} }
} // namespace chatterino } // namespace chatterino

View file

@ -14,9 +14,6 @@ class HighlightingPage : public SettingsPage
{ {
public: public:
HighlightingPage(); HighlightingPage();
private:
QTimer disabledUsersChangedTimer;
}; };
} // namespace chatterino } // namespace chatterino