From e0e33bc5f073799c33be3fdcb7ac38ff948792af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Br=C3=BCbach=2C=20Lukas?= Date: Fri, 28 Nov 2025 22:32:56 +0100 Subject: [PATCH] [Fix-Warnings] Replace types with auto for game/zones files --- cockatrice/src/game/zones/table_zone.cpp | 4 ++-- cockatrice/src/game/zones/view_zone.cpp | 2 +- .../src/game/zones/view_zone_widget.cpp | 24 +++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cockatrice/src/game/zones/table_zone.cpp b/cockatrice/src/game/zones/table_zone.cpp index 55aaeaa39..aa31ce248 100644 --- a/cockatrice/src/game/zones/table_zone.cpp +++ b/cockatrice/src/game/zones/table_zone.cpp @@ -204,9 +204,9 @@ void TableZone::toggleTapped() }); QList cmdList; for (const auto &selectedItem : selectedItems) { - CardItem *temp = qgraphicsitem_cast(selectedItem); + auto *temp = qgraphicsitem_cast(selectedItem); if (temp->getTapped() != tapAll) { - Command_SetCardAttr *cmd = new Command_SetCardAttr; + auto *cmd = new Command_SetCardAttr; cmd->set_zone(getLogic()->getName().toStdString()); cmd->set_card_id(temp->getId()); cmd->set_attribute(AttrTapped); diff --git a/cockatrice/src/game/zones/view_zone.cpp b/cockatrice/src/game/zones/view_zone.cpp index d5eea9dfe..f6be544db 100644 --- a/cockatrice/src/game/zones/view_zone.cpp +++ b/cockatrice/src/game/zones/view_zone.cpp @@ -119,7 +119,7 @@ void ZoneViewZone::zoneDumpReceived(const Response &r) void ZoneViewZone::reorganizeCards() { // filter cards - CardList cardsToDisplay = CardList(getLogic()->getCards().getContentsKnown()); + auto cardsToDisplay = CardList(getLogic()->getCards().getContentsKnown()); for (auto card : getLogic()->getCards()) { if (filterString.check(card->getCard().getCardPtr())) { card->show(); diff --git a/cockatrice/src/game/zones/view_zone_widget.cpp b/cockatrice/src/game/zones/view_zone_widget.cpp index e2f242883..22e1c2c54 100644 --- a/cockatrice/src/game/zones/view_zone_widget.cpp +++ b/cockatrice/src/game/zones/view_zone_widget.cpp @@ -42,7 +42,7 @@ ZoneViewWidget::ZoneViewWidget(Player *_player, setZValue(2000000006); setFlag(ItemIgnoresTransformations); - QGraphicsLinearLayout *vbox = new QGraphicsLinearLayout(Qt::Vertical); + auto *vbox = new QGraphicsLinearLayout(Qt::Vertical); vbox->setSpacing(2); // If the number is < 0, then it means that we can give the option to make the area sorted @@ -61,22 +61,22 @@ ZoneViewWidget::ZoneViewWidget(Player *_player, searchEdit.setFocus(); } - QGraphicsProxyWidget *searchEditProxy = new QGraphicsProxyWidget; + auto *searchEditProxy = new QGraphicsProxyWidget; searchEditProxy->setWidget(&searchEdit); searchEditProxy->setZValue(2000000007); vbox->addItem(searchEditProxy); // top row - QGraphicsLinearLayout *hTopRow = new QGraphicsLinearLayout(Qt::Horizontal); + auto *hTopRow = new QGraphicsLinearLayout(Qt::Horizontal); // groupBy options - QGraphicsProxyWidget *groupBySelectorProxy = new QGraphicsProxyWidget; + auto *groupBySelectorProxy = new QGraphicsProxyWidget; groupBySelectorProxy->setWidget(&groupBySelector); groupBySelectorProxy->setZValue(2000000008); hTopRow->addItem(groupBySelectorProxy); // sortBy options - QGraphicsProxyWidget *sortBySelectorProxy = new QGraphicsProxyWidget; + auto *sortBySelectorProxy = new QGraphicsProxyWidget; sortBySelectorProxy->setWidget(&sortBySelector); sortBySelectorProxy->setZValue(2000000007); hTopRow->addItem(sortBySelectorProxy); @@ -84,25 +84,25 @@ ZoneViewWidget::ZoneViewWidget(Player *_player, vbox->addItem(hTopRow); // line - QGraphicsProxyWidget *lineProxy = new QGraphicsProxyWidget; - QFrame *line = new QFrame; + auto *lineProxy = new QGraphicsProxyWidget; + auto *line = new QFrame; line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); lineProxy->setWidget(line); vbox->addItem(lineProxy); // bottom row - QGraphicsLinearLayout *hBottomRow = new QGraphicsLinearLayout(Qt::Horizontal); + auto *hBottomRow = new QGraphicsLinearLayout(Qt::Horizontal); // pile view options - QGraphicsProxyWidget *pileViewProxy = new QGraphicsProxyWidget; + auto *pileViewProxy = new QGraphicsProxyWidget; pileViewProxy->setWidget(&pileViewCheckBox); hBottomRow->addItem(pileViewProxy); // shuffle options if (_origZone->getIsShufflable() && numberCards == -1) { shuffleCheckBox.setChecked(true); - QGraphicsProxyWidget *shuffleProxy = new QGraphicsProxyWidget; + auto *shuffleProxy = new QGraphicsProxyWidget; shuffleProxy->setWidget(&shuffleCheckBox); hBottomRow->addItem(shuffleProxy); } @@ -112,7 +112,7 @@ ZoneViewWidget::ZoneViewWidget(Player *_player, extraHeight = vbox->sizeHint(Qt::PreferredSize).height(); - QGraphicsLinearLayout *zoneHBox = new QGraphicsLinearLayout(Qt::Horizontal); + auto *zoneHBox = new QGraphicsLinearLayout(Qt::Horizontal); zoneContainer = new QGraphicsWidget(this); zoneContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -367,7 +367,7 @@ void ZoneViewWidget::zoneDeleted() void ZoneViewWidget::initStyleOption(QStyleOption *option) const { - QStyleOptionTitleBar *titleBar = qstyleoption_cast(option); + auto *titleBar = qstyleoption_cast(option); if (titleBar) titleBar->icon = QPixmap("theme:cockatrice"); }