[Fix-Warnings] Replace types with auto for game/zones files

This commit is contained in:
Brübach, Lukas 2025-11-28 22:32:56 +01:00
parent 6a717e1044
commit e0e33bc5f0
3 changed files with 15 additions and 15 deletions

View file

@ -204,9 +204,9 @@ void TableZone::toggleTapped()
}); });
QList<const ::google::protobuf::Message *> cmdList; QList<const ::google::protobuf::Message *> cmdList;
for (const auto &selectedItem : selectedItems) { for (const auto &selectedItem : selectedItems) {
CardItem *temp = qgraphicsitem_cast<CardItem *>(selectedItem); auto *temp = qgraphicsitem_cast<CardItem *>(selectedItem);
if (temp->getTapped() != tapAll) { if (temp->getTapped() != tapAll) {
Command_SetCardAttr *cmd = new Command_SetCardAttr; auto *cmd = new Command_SetCardAttr;
cmd->set_zone(getLogic()->getName().toStdString()); cmd->set_zone(getLogic()->getName().toStdString());
cmd->set_card_id(temp->getId()); cmd->set_card_id(temp->getId());
cmd->set_attribute(AttrTapped); cmd->set_attribute(AttrTapped);

View file

@ -119,7 +119,7 @@ void ZoneViewZone::zoneDumpReceived(const Response &r)
void ZoneViewZone::reorganizeCards() void ZoneViewZone::reorganizeCards()
{ {
// filter cards // filter cards
CardList cardsToDisplay = CardList(getLogic()->getCards().getContentsKnown()); auto cardsToDisplay = CardList(getLogic()->getCards().getContentsKnown());
for (auto card : getLogic()->getCards()) { for (auto card : getLogic()->getCards()) {
if (filterString.check(card->getCard().getCardPtr())) { if (filterString.check(card->getCard().getCardPtr())) {
card->show(); card->show();

View file

@ -42,7 +42,7 @@ ZoneViewWidget::ZoneViewWidget(Player *_player,
setZValue(2000000006); setZValue(2000000006);
setFlag(ItemIgnoresTransformations); setFlag(ItemIgnoresTransformations);
QGraphicsLinearLayout *vbox = new QGraphicsLinearLayout(Qt::Vertical); auto *vbox = new QGraphicsLinearLayout(Qt::Vertical);
vbox->setSpacing(2); vbox->setSpacing(2);
// If the number is < 0, then it means that we can give the option to make the area sorted // 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(); searchEdit.setFocus();
} }
QGraphicsProxyWidget *searchEditProxy = new QGraphicsProxyWidget; auto *searchEditProxy = new QGraphicsProxyWidget;
searchEditProxy->setWidget(&searchEdit); searchEditProxy->setWidget(&searchEdit);
searchEditProxy->setZValue(2000000007); searchEditProxy->setZValue(2000000007);
vbox->addItem(searchEditProxy); vbox->addItem(searchEditProxy);
// top row // top row
QGraphicsLinearLayout *hTopRow = new QGraphicsLinearLayout(Qt::Horizontal); auto *hTopRow = new QGraphicsLinearLayout(Qt::Horizontal);
// groupBy options // groupBy options
QGraphicsProxyWidget *groupBySelectorProxy = new QGraphicsProxyWidget; auto *groupBySelectorProxy = new QGraphicsProxyWidget;
groupBySelectorProxy->setWidget(&groupBySelector); groupBySelectorProxy->setWidget(&groupBySelector);
groupBySelectorProxy->setZValue(2000000008); groupBySelectorProxy->setZValue(2000000008);
hTopRow->addItem(groupBySelectorProxy); hTopRow->addItem(groupBySelectorProxy);
// sortBy options // sortBy options
QGraphicsProxyWidget *sortBySelectorProxy = new QGraphicsProxyWidget; auto *sortBySelectorProxy = new QGraphicsProxyWidget;
sortBySelectorProxy->setWidget(&sortBySelector); sortBySelectorProxy->setWidget(&sortBySelector);
sortBySelectorProxy->setZValue(2000000007); sortBySelectorProxy->setZValue(2000000007);
hTopRow->addItem(sortBySelectorProxy); hTopRow->addItem(sortBySelectorProxy);
@ -84,25 +84,25 @@ ZoneViewWidget::ZoneViewWidget(Player *_player,
vbox->addItem(hTopRow); vbox->addItem(hTopRow);
// line // line
QGraphicsProxyWidget *lineProxy = new QGraphicsProxyWidget; auto *lineProxy = new QGraphicsProxyWidget;
QFrame *line = new QFrame; auto *line = new QFrame;
line->setFrameShape(QFrame::HLine); line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken); line->setFrameShadow(QFrame::Sunken);
lineProxy->setWidget(line); lineProxy->setWidget(line);
vbox->addItem(lineProxy); vbox->addItem(lineProxy);
// bottom row // bottom row
QGraphicsLinearLayout *hBottomRow = new QGraphicsLinearLayout(Qt::Horizontal); auto *hBottomRow = new QGraphicsLinearLayout(Qt::Horizontal);
// pile view options // pile view options
QGraphicsProxyWidget *pileViewProxy = new QGraphicsProxyWidget; auto *pileViewProxy = new QGraphicsProxyWidget;
pileViewProxy->setWidget(&pileViewCheckBox); pileViewProxy->setWidget(&pileViewCheckBox);
hBottomRow->addItem(pileViewProxy); hBottomRow->addItem(pileViewProxy);
// shuffle options // shuffle options
if (_origZone->getIsShufflable() && numberCards == -1) { if (_origZone->getIsShufflable() && numberCards == -1) {
shuffleCheckBox.setChecked(true); shuffleCheckBox.setChecked(true);
QGraphicsProxyWidget *shuffleProxy = new QGraphicsProxyWidget; auto *shuffleProxy = new QGraphicsProxyWidget;
shuffleProxy->setWidget(&shuffleCheckBox); shuffleProxy->setWidget(&shuffleCheckBox);
hBottomRow->addItem(shuffleProxy); hBottomRow->addItem(shuffleProxy);
} }
@ -112,7 +112,7 @@ ZoneViewWidget::ZoneViewWidget(Player *_player,
extraHeight = vbox->sizeHint(Qt::PreferredSize).height(); extraHeight = vbox->sizeHint(Qt::PreferredSize).height();
QGraphicsLinearLayout *zoneHBox = new QGraphicsLinearLayout(Qt::Horizontal); auto *zoneHBox = new QGraphicsLinearLayout(Qt::Horizontal);
zoneContainer = new QGraphicsWidget(this); zoneContainer = new QGraphicsWidget(this);
zoneContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); zoneContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
@ -367,7 +367,7 @@ void ZoneViewWidget::zoneDeleted()
void ZoneViewWidget::initStyleOption(QStyleOption *option) const void ZoneViewWidget::initStyleOption(QStyleOption *option) const
{ {
QStyleOptionTitleBar *titleBar = qstyleoption_cast<QStyleOptionTitleBar *>(option); auto *titleBar = qstyleoption_cast<QStyleOptionTitleBar *>(option);
if (titleBar) if (titleBar)
titleBar->icon = QPixmap("theme:cockatrice"); titleBar->icon = QPixmap("theme:cockatrice");
} }