fixed timestamps not updating when changed in the settings

This commit is contained in:
fourtf
2018-01-23 21:56:25 +01:00
parent f292d2e097
commit 8a77f918f6
5 changed files with 18 additions and 5 deletions
+10 -2
View File
@@ -2,6 +2,7 @@
#include "debug/log.hpp"
#include "singletons/pathmanager.hpp"
#include "singletons/resourcemanager.hpp"
#include "singletons/windowmanager.hpp"
using namespace chatterino::messages;
@@ -31,6 +32,9 @@ SettingManager::SettingManager()
this->moderationActions.connect([this](auto, auto) { this->updateModerationActions(); });
this->ignoredKeywords.connect([this](auto, auto) { this->updateIgnoredKeywords(); });
this->timestampFormat.connect(
[](auto, auto) { singletons::WindowManager::getInstance().layoutVisibleChatWidgets(); });
}
MessageElement::Flags SettingManager::getWordFlags()
@@ -216,8 +220,12 @@ void SettingManager::updateIgnoredKeywords()
auto items = new std::vector<QString>();
for (QString line : this->ignoredKeywords.getValue().split(newLineRegex)) {
items->push_back(line);
for (const QString &line : this->ignoredKeywords.getValue().split(newLineRegex)) {
QString line2 = line.trimmed();
if (!line2.isEmpty()) {
items->push_back(line2);
}
}
this->_ignoredKeywords = std::shared_ptr<std::vector<QString>>(items);