moved some Settings from Application to Settings

This commit is contained in:
fourtf
2020-02-23 22:15:13 +01:00
parent f8a9850151
commit 5ad427bd61
11 changed files with 102 additions and 77 deletions
+26 -1
View File
@@ -5,13 +5,38 @@
#include "BaseSettings.hpp"
#include "common/Channel.hpp"
#include "common/SignalVector.hpp"
#include "controllers/highlights/HighlightPhrase.hpp"
#include "controllers/moderationactions/ModerationAction.hpp"
#include "singletons/Toasts.hpp"
namespace chatterino {
class Settings : public ABSettings
class HighlightPhrase;
class HighlightBlacklistUser;
class IgnorePhrase;
// Settings which are availlable for reading on all threads.
class ConcurrentSettings
{
public:
ConcurrentSettings();
// clang-format off
SignalVector<HighlightPhrase> &highlightedMessages;
SignalVector<HighlightPhrase> &highlightedUsers;
SignalVector<HighlightBlacklistUser> &blacklistedUsers;
SignalVector<IgnorePhrase> &ignoredMessages;
// clang-format on
bool isHighlightedUser(const QString &username);
bool isBlacklistedUser(const QString &username);
};
ConcurrentSettings &getCSettings();
// These settings are still accessed concurrently in the code but it is bad practice.
class Settings : public ABSettings, public ConcurrentSettings
{
static Settings *instance_;