get UserListProxy from TabSupervisor instead of passing it in the constructor (#5490)

This commit is contained in:
RickyRister 2025-01-17 07:27:52 -08:00 committed by GitHub
parent 92a903b035
commit 2bc71095dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 32 additions and 52 deletions

View file

@ -15,6 +15,7 @@
#include "../../main.h"
#include "../../server/message_log_widget.h"
#include "../../server/pending_command.h"
#include "../../server/user/user_list_manager.h"
#include "../../settings/cache_settings.h"
#include "../game_logic/abstract_client.h"
#include "../network/replay_timeline_widget.h"
@ -123,16 +124,16 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay)
}
TabGame::TabGame(TabSupervisor *_tabSupervisor,
UserListProxy *_userListProxy,
QList<AbstractClient *> &_clients,
const Event_GameJoined &event,
const QMap<int, QString> &_roomGameTypes)
: Tab(_tabSupervisor), userListProxy(_userListProxy), clients(_clients), gameInfo(event.game_info()),
roomGameTypes(_roomGameTypes), hostId(event.host_id()), localPlayerId(event.player_id()),
isLocalGame(_tabSupervisor->getIsLocalGame()), spectator(event.spectator()), judge(event.judge()),
gameStateKnown(false), resuming(event.resuming()), currentPhase(-1), activeCard(nullptr), gameClosed(false),
replay(nullptr), replayPlayButton(nullptr), replayFastForwardButton(nullptr), aReplaySkipForward(nullptr),
aReplaySkipBackward(nullptr), aReplaySkipForwardBig(nullptr), aReplaySkipBackwardBig(nullptr), replayDock(nullptr)
: Tab(_tabSupervisor), userListProxy(_tabSupervisor->getUserListManager()), clients(_clients),
gameInfo(event.game_info()), roomGameTypes(_roomGameTypes), hostId(event.host_id()),
localPlayerId(event.player_id()), isLocalGame(_tabSupervisor->getIsLocalGame()), spectator(event.spectator()),
judge(event.judge()), gameStateKnown(false), resuming(event.resuming()), currentPhase(-1), activeCard(nullptr),
gameClosed(false), replay(nullptr), replayPlayButton(nullptr), replayFastForwardButton(nullptr),
aReplaySkipForward(nullptr), aReplaySkipBackward(nullptr), aReplaySkipForwardBig(nullptr),
aReplaySkipBackwardBig(nullptr), replayDock(nullptr)
{
// THIS CTOR IS USED ON GAMES
gameInfo.set_started(false);
@ -1684,7 +1685,7 @@ void TabGame::createPlayerListDock(bool bReplay)
void TabGame::createMessageDock(bool bReplay)
{
messageLog = new MessageLogWidget(tabSupervisor, userListProxy, this);
messageLog = new MessageLogWidget(tabSupervisor, this);
connect(messageLog, SIGNAL(cardNameHovered(QString)), cardInfoFrameWidget, SLOT(setCard(QString)));
connect(messageLog, &MessageLogWidget::showCardInfoPopup, this, &TabGame::showCardInfoPopup);
connect(messageLog, SIGNAL(deleteCardInfoPopup(QString)), this, SLOT(deleteCardInfoPopup(QString)));