From 27580f1d4a4963bacc8cc6e8330bae115cd87a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Tue, 9 Sep 2025 21:32:33 +0200 Subject: [PATCH] Lint. Took 3 minutes --- cockatrice/src/client/tabs/tab_game.cpp | 16 ++++++++++------ cockatrice/src/game/player/player_actions.cpp | 6 ++++-- .../src/game/player/player_list_widget.cpp | 3 +-- cockatrice/src/game/player/player_target.cpp | 5 +---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/cockatrice/src/client/tabs/tab_game.cpp b/cockatrice/src/client/tabs/tab_game.cpp index e4478a9bb..7f5aa6394 100644 --- a/cockatrice/src/client/tabs/tab_game.cpp +++ b/cockatrice/src/client/tabs/tab_game.cpp @@ -253,7 +253,8 @@ void TabGame::resetChatAndPhase() void TabGame::emitUserEvent() { - bool globalEvent = !game->getPlayerManager()->isSpectator() || SettingsCache::instance().getSpectatorNotificationsEnabled(); + bool globalEvent = + !game->getPlayerManager()->isSpectator() || SettingsCache::instance().getSpectatorNotificationsEnabled(); emit userEvent(globalEvent); updatePlayerListDockTitle(); } @@ -267,15 +268,16 @@ void TabGame::updatePlayerListDockTitle() { QString tabText = " | " + (replayManager->replay ? tr("Replay") : tr("Game")) + " #" + QString::number(game->getGameMetaInfo()->gameId()); - QString userCountInfo = QString(" %1/%2").arg(game->getPlayerManager()->getPlayerCount()).arg(game->getGameMetaInfo()->maxPlayers()); + QString userCountInfo = + QString(" %1/%2").arg(game->getPlayerManager()->getPlayerCount()).arg(game->getGameMetaInfo()->maxPlayers()); playerListDock->setWindowTitle(tr("Player List") + userCountInfo + (playerListDock->isWindow() ? tabText : QString())); } void TabGame::retranslateUi() { - QString tabText = - " | " + (replayManager->replay ? tr("Replay") : tr("Game")) + " #" + QString::number(game->getGameMetaInfo()->gameId()); + QString tabText = " | " + (replayManager->replay ? tr("Replay") : tr("Game")) + " #" + + QString::number(game->getGameMetaInfo()->gameId()); updatePlayerListDockTitle(); cardInfoDock->setWindowTitle(tr("Card Info") + (cardInfoDock->isWindow() ? tabText : QString())); @@ -668,7 +670,8 @@ Player *TabGame::addPlayer(Player *newPlayer) messageLog->connectToPlayerEventHandler(newPlayer->getPlayerEventHandler()); if (game->getGameState()->getIsLocalGame() || - (game->getPlayerManager()->isLocalPlayer(newPlayer->getPlayerInfo()->getId()) && !game->getPlayerManager()->isSpectator())) { + (game->getPlayerManager()->isLocalPlayer(newPlayer->getPlayerInfo()->getId()) && + !game->getPlayerManager()->isSpectator())) { addLocalPlayer(newPlayer, newPlayer->getPlayerInfo()->getId()); } @@ -924,7 +927,8 @@ void TabGame::createMenuItems() connect(aReverseTurn, &QAction::triggered, game->getGameEventHandler(), &GameEventHandler::handleReverseTurn); aRemoveLocalArrows = new QAction(this); connect(aRemoveLocalArrows, &QAction::triggered, this, &TabGame::actRemoveLocalArrows); - connect(this, &TabGame::arrowDeletionRequested, game->getGameEventHandler(), &GameEventHandler::handleArrowDeletion); + connect(this, &TabGame::arrowDeletionRequested, game->getGameEventHandler(), + &GameEventHandler::handleArrowDeletion); aRotateViewCW = new QAction(this); connect(aRotateViewCW, &QAction::triggered, this, &TabGame::actRotateViewCW); aRotateViewCCW = new QAction(this); diff --git a/cockatrice/src/game/player/player_actions.cpp b/cockatrice/src/game/player/player_actions.cpp index d743f9aae..37d2b4b5e 100644 --- a/cockatrice/src/game/player/player_actions.cpp +++ b/cockatrice/src/game/player/player_actions.cpp @@ -323,7 +323,8 @@ void PlayerActions::actDrawCards() int deckSize = player->getDeckZone()->getCards().size(); bool ok; int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Draw cards"), - tr("Number of cards: (max. %1)").arg(deckSize), defaultNumberTopCards, 1, deckSize, 1, &ok); + tr("Number of cards: (max. %1)").arg(deckSize), defaultNumberTopCards, 1, + deckSize, 1, &ok); if (ok) { defaultNumberTopCards = number; Command_DrawCards cmd; @@ -747,7 +748,8 @@ void PlayerActions::actDrawBottomCards() bool ok; int number = QInputDialog::getInt(/* player->getGame() */ nullptr, tr("Draw bottom cards"), - tr("Number of cards: (max. %1)").arg(maxCards), defaultNumberBottomCards, 1, maxCards, 1, &ok); + tr("Number of cards: (max. %1)").arg(maxCards), defaultNumberBottomCards, 1, + maxCards, 1, &ok); if (!ok) { return; } else if (number > maxCards) { diff --git a/cockatrice/src/game/player/player_list_widget.cpp b/cockatrice/src/game/player/player_list_widget.cpp index e2e329603..5b97d6613 100644 --- a/cockatrice/src/game/player/player_list_widget.cpp +++ b/cockatrice/src/game/player/player_list_widget.cpp @@ -54,8 +54,7 @@ bool PlayerListTWI::operator<(const QTreeWidgetItem &other) const return data(4, Qt::UserRole + 1).toInt() < other.data(4, Qt::UserRole + 1).toInt(); } -PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor, - AbstractClient *_client, Game *_game, QWidget *parent) +PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient *_client, Game *_game, QWidget *parent) : QTreeWidget(parent), tabSupervisor(_tabSupervisor), client(_client), game(_game), gameStarted(false) { readyIcon = QPixmap("theme:icons/ready_start"); diff --git a/cockatrice/src/game/player/player_target.cpp b/cockatrice/src/game/player/player_target.cpp index 9e1b6bc46..ffc934822 100644 --- a/cockatrice/src/game/player/player_target.cpp +++ b/cockatrice/src/game/player/player_target.cpp @@ -9,10 +9,7 @@ #include #include -PlayerCounter::PlayerCounter(Player *_player, - int _id, - const QString &_name, - int _value, QGraphicsItem *parent) +PlayerCounter::PlayerCounter(Player *_player, int _id, const QString &_name, int _value, QGraphicsItem *parent) : AbstractCounter(_player, _id, _name, false, _value, false, parent) { }