mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
[Settings] Split cache_settings monolith into multiple SettingsManager sub-classes (#7050)
* [Settings] Split cache_settings into multiple files Took 9 minutes Took 4 minutes * [Settings] Fwd declare settings classes in cache_settings Took 15 minutes * Fix oracle includes. Took 8 minutes * Address comments, fix windows CI Took 8 minutes * fix copy constructor visibility Took 3 minutes * lint Took 2 minutes * Fix native format tests. Took 5 minutes * Remove test header guard Took 4 seconds * Remove tests invalid in CI environ Took 24 seconds * Adjust to rebase. Took 11 minutes * Change settings file name. Took 8 minutes --------- Co-authored-by: Lukas Brübach <lukas.bruebach@bdosecurity.de> Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
cf0b453e75
commit
12f0f59453
166 changed files with 5589 additions and 3066 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "tab_room.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../../client/settings/shortcuts_settings.h"
|
||||
#include "../interface/widgets/dialogs/dlg_settings.h"
|
||||
#include "../interface/widgets/server/chat_view/chat_view.h"
|
||||
#include "../interface/widgets/server/game_selector.h"
|
||||
|
|
@ -31,6 +32,7 @@
|
|||
#include <libcockatrice/protocol/pb/room_commands.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_room.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/chat_settings.h>
|
||||
#include <libcockatrice/utility/string_limits.h>
|
||||
|
||||
TabRoom::TabRoom(TabSupervisor *_tabSupervisor,
|
||||
|
|
@ -75,7 +77,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor,
|
|||
connect(chatView, &ChatView::showCardInfoPopup, this, &TabRoom::showCardInfoPopup);
|
||||
connect(chatView, &ChatView::deleteCardInfoPopup, this, &TabRoom::deleteCardInfoPopup);
|
||||
connect(chatView, &ChatView::addMentionTag, this, &TabRoom::addMentionTag);
|
||||
connect(&SettingsCache::instance(), &SettingsCache::chatMentionCompleterChanged, this,
|
||||
connect(&SettingsCache::instance().chat(), &ChatSettings::chatMentionCompleterChanged, this,
|
||||
&TabRoom::actCompleterChanged);
|
||||
sayLabel = new QLabel;
|
||||
sayEdit = new LineEditCompleter;
|
||||
|
|
@ -246,8 +248,8 @@ void TabRoom::actOpenChatSettings()
|
|||
|
||||
void TabRoom::actCompleterChanged()
|
||||
{
|
||||
SettingsCache::instance().getChatMentionCompleter() ? completer->setCompletionRole(2)
|
||||
: completer->setCompletionRole(1);
|
||||
SettingsCache::instance().chat().getChatMentionCompleter() ? completer->setCompletionRole(2)
|
||||
: completer->setCompletionRole(1);
|
||||
}
|
||||
|
||||
void TabRoom::processRoomEvent(const RoomEvent &event)
|
||||
|
|
@ -307,13 +309,13 @@ void TabRoom::processRoomSayEvent(const Event_RoomSay &event)
|
|||
ServerInfo_User userInfo = {};
|
||||
if (twi) {
|
||||
userInfo = twi->getUserInfo();
|
||||
if (SettingsCache::instance().getIgnoreUnregisteredUsers() &&
|
||||
if (SettingsCache::instance().chat().getIgnoreUnregisteredUsers() &&
|
||||
!UserLevelFlags(userInfo.user_level()).testFlag(ServerInfo_User::IsRegistered)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (event.message_type() == Event_RoomSay::ChatHistory && !SettingsCache::instance().getRoomHistory()) {
|
||||
if (event.message_type() == Event_RoomSay::ChatHistory && !SettingsCache::instance().chat().getRoomHistory()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue