mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 02:53:56 -07:00
Address /W4 compiler warnings for Windows (#4910)
This commit is contained in:
parent
cb90a8356b
commit
186f4289e9
50 changed files with 279 additions and 272 deletions
|
|
@ -612,22 +612,22 @@ QStringList CardDatabase::getAllMainCardTypes() const
|
|||
|
||||
void CardDatabase::checkUnknownSets()
|
||||
{
|
||||
SetList sets = getSetList();
|
||||
auto _sets = getSetList();
|
||||
|
||||
if (sets.getEnabledSetsNum()) {
|
||||
if (_sets.getEnabledSetsNum()) {
|
||||
// if some sets are first found on this run, ask the user
|
||||
int numUnknownSets = sets.getUnknownSetsNum();
|
||||
QStringList unknownSetNames = sets.getUnknownSetsNames();
|
||||
int numUnknownSets = _sets.getUnknownSetsNum();
|
||||
QStringList unknownSetNames = _sets.getUnknownSetsNames();
|
||||
if (numUnknownSets > 0) {
|
||||
emit cardDatabaseNewSetsFound(numUnknownSets, unknownSetNames);
|
||||
} else {
|
||||
sets.markAllAsKnown();
|
||||
_sets.markAllAsKnown();
|
||||
}
|
||||
} else {
|
||||
// No set enabled. Probably this is the first time running trice
|
||||
sets.guessSortKeys();
|
||||
sets.sortByKey();
|
||||
sets.enableAll();
|
||||
_sets.guessSortKeys();
|
||||
_sets.sortByKey();
|
||||
_sets.enableAll();
|
||||
notifyEnabledSetsChanged();
|
||||
|
||||
emit cardDatabaseAllNewSetsEnabled();
|
||||
|
|
@ -636,14 +636,14 @@ void CardDatabase::checkUnknownSets()
|
|||
|
||||
void CardDatabase::enableAllUnknownSets()
|
||||
{
|
||||
SetList sets = getSetList();
|
||||
sets.enableAllUnknown();
|
||||
auto _sets = getSetList();
|
||||
_sets.enableAllUnknown();
|
||||
}
|
||||
|
||||
void CardDatabase::markAllSetsAsKnown()
|
||||
{
|
||||
SetList sets = getSetList();
|
||||
sets.markAllAsKnown();
|
||||
auto _sets = getSetList();
|
||||
_sets.markAllAsKnown();
|
||||
}
|
||||
|
||||
void CardDatabase::notifyEnabledSetsChanged()
|
||||
|
|
|
|||
|
|
@ -326,12 +326,12 @@ void CardDatabaseDisplayModel::clearFilterAll()
|
|||
invalidateFilter();
|
||||
}
|
||||
|
||||
void CardDatabaseDisplayModel::setFilterTree(FilterTree *filterTree)
|
||||
void CardDatabaseDisplayModel::setFilterTree(FilterTree *_filterTree)
|
||||
{
|
||||
if (this->filterTree != nullptr)
|
||||
disconnect(this->filterTree, nullptr, this, nullptr);
|
||||
|
||||
this->filterTree = filterTree;
|
||||
this->filterTree = _filterTree;
|
||||
connect(this->filterTree, SIGNAL(changed()), this, SLOT(filterTreeChanged()));
|
||||
invalidate();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ private:
|
|||
|
||||
public:
|
||||
explicit CardDatabaseDisplayModel(QObject *parent = nullptr);
|
||||
void setFilterTree(FilterTree *filterTree);
|
||||
void setFilterTree(FilterTree *_filterTree);
|
||||
void setIsToken(FilterBool _isToken)
|
||||
{
|
||||
isToken = _isToken;
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
|||
QVariantHash properties = QVariantHash();
|
||||
QString colors = QString("");
|
||||
QList<CardRelation *> relatedCards, reverseRelatedCards;
|
||||
CardInfoPerSetMap sets = CardInfoPerSetMap();
|
||||
auto _sets = CardInfoPerSetMap();
|
||||
int tableRow = 0;
|
||||
bool cipt = false;
|
||||
bool isToken = false;
|
||||
|
|
@ -221,7 +221,7 @@ void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
|||
if (attrs.hasAttribute("rarity")) {
|
||||
setInfo.setProperty("rarity", attrs.value("rarity").toString());
|
||||
}
|
||||
sets.insert(setName, setInfo);
|
||||
_sets.insert(setName, setInfo);
|
||||
// related cards
|
||||
} else if (xmlName == "related" || xmlName == "reverse-related") {
|
||||
CardRelation::AttachType attach = CardRelation::DoesNotAttach;
|
||||
|
|
@ -268,7 +268,7 @@ void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
|||
|
||||
properties.insert("colors", colors);
|
||||
CardInfoPtr newCard = CardInfo::newInstance(name, text, isToken, properties, relatedCards,
|
||||
reverseRelatedCards, sets, cipt, tableRow, upsideDown);
|
||||
reverseRelatedCards, _sets, cipt, tableRow, upsideDown);
|
||||
emit addCard(newCard);
|
||||
}
|
||||
}
|
||||
|
|
@ -412,7 +412,7 @@ static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfoPtr &in
|
|||
return xml;
|
||||
}
|
||||
|
||||
bool CockatriceXml3Parser::saveToFile(SetNameMap sets,
|
||||
bool CockatriceXml3Parser::saveToFile(SetNameMap _sets,
|
||||
CardNameMap cards,
|
||||
const QString &fileName,
|
||||
const QString &sourceUrl,
|
||||
|
|
@ -439,9 +439,9 @@ bool CockatriceXml3Parser::saveToFile(SetNameMap sets,
|
|||
xml.writeTextElement("sourceVersion", sourceVersion);
|
||||
xml.writeEndElement();
|
||||
|
||||
if (sets.count() > 0) {
|
||||
if (_sets.count() > 0) {
|
||||
xml.writeStartElement("sets");
|
||||
for (CardSetPtr set : sets) {
|
||||
for (CardSetPtr set : _sets) {
|
||||
xml << set;
|
||||
}
|
||||
xml.writeEndElement();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public:
|
|||
~CockatriceXml3Parser() override = default;
|
||||
bool getCanParseFile(const QString &name, QIODevice &device) override;
|
||||
void parseFile(QIODevice &device) override;
|
||||
bool saveToFile(SetNameMap sets,
|
||||
bool saveToFile(SetNameMap _sets,
|
||||
CardNameMap cards,
|
||||
const QString &fileName,
|
||||
const QString &sourceUrl = "unknown",
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ void CockatriceXml4Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
|||
QString text = QString("");
|
||||
QVariantHash properties = QVariantHash();
|
||||
QList<CardRelation *> relatedCards, reverseRelatedCards;
|
||||
CardInfoPerSetMap sets = CardInfoPerSetMap();
|
||||
auto _sets = CardInfoPerSetMap();
|
||||
int tableRow = 0;
|
||||
bool cipt = false;
|
||||
bool isToken = false;
|
||||
|
|
@ -178,7 +178,7 @@ void CockatriceXml4Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
|||
attrName = "picurl";
|
||||
setInfo.setProperty(attrName, attr.value().toString());
|
||||
}
|
||||
sets.insert(setName, setInfo);
|
||||
_sets.insert(setName, setInfo);
|
||||
}
|
||||
// related cards
|
||||
} else if (xmlName == "related" || xmlName == "reverse-related") {
|
||||
|
|
@ -231,7 +231,7 @@ void CockatriceXml4Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
|||
}
|
||||
|
||||
CardInfoPtr newCard = CardInfo::newInstance(name, text, isToken, properties, relatedCards,
|
||||
reverseRelatedCards, sets, cipt, tableRow, upsideDown);
|
||||
reverseRelatedCards, _sets, cipt, tableRow, upsideDown);
|
||||
emit addCard(newCard);
|
||||
}
|
||||
}
|
||||
|
|
@ -356,7 +356,7 @@ static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfoPtr &in
|
|||
return xml;
|
||||
}
|
||||
|
||||
bool CockatriceXml4Parser::saveToFile(SetNameMap sets,
|
||||
bool CockatriceXml4Parser::saveToFile(SetNameMap _sets,
|
||||
CardNameMap cards,
|
||||
const QString &fileName,
|
||||
const QString &sourceUrl,
|
||||
|
|
@ -383,9 +383,9 @@ bool CockatriceXml4Parser::saveToFile(SetNameMap sets,
|
|||
xml.writeTextElement("sourceVersion", sourceVersion);
|
||||
xml.writeEndElement();
|
||||
|
||||
if (sets.count() > 0) {
|
||||
if (_sets.count() > 0) {
|
||||
xml.writeStartElement("sets");
|
||||
for (CardSetPtr set : sets) {
|
||||
for (CardSetPtr set : _sets) {
|
||||
xml << set;
|
||||
}
|
||||
xml.writeEndElement();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public:
|
|||
~CockatriceXml4Parser() override = default;
|
||||
bool getCanParseFile(const QString &name, QIODevice &device) override;
|
||||
void parseFile(QIODevice &device) override;
|
||||
bool saveToFile(SetNameMap sets,
|
||||
bool saveToFile(SetNameMap _sets,
|
||||
CardNameMap cards,
|
||||
const QString &fileName,
|
||||
const QString &sourceUrl = "unknown",
|
||||
|
|
|
|||
|
|
@ -97,10 +97,10 @@ void CardItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||
QMapIterator<int, int> counterIterator(counters);
|
||||
while (counterIterator.hasNext()) {
|
||||
counterIterator.next();
|
||||
QColor color;
|
||||
color.setHsv(counterIterator.key() * 60, 150, 255);
|
||||
QColor _color;
|
||||
_color.setHsv(counterIterator.key() * 60, 150, 255);
|
||||
|
||||
paintNumberEllipse(counterIterator.value(), 14, color, i, counters.size(), painter);
|
||||
paintNumberEllipse(counterIterator.value(), 14, _color, i, counters.size(), painter);
|
||||
++i;
|
||||
}
|
||||
|
||||
|
|
@ -233,25 +233,25 @@ void CardItem::resetState()
|
|||
update();
|
||||
}
|
||||
|
||||
void CardItem::processCardInfo(const ServerInfo_Card &info)
|
||||
void CardItem::processCardInfo(const ServerInfo_Card &_info)
|
||||
{
|
||||
counters.clear();
|
||||
const int counterListSize = info.counter_list_size();
|
||||
const int counterListSize = _info.counter_list_size();
|
||||
for (int i = 0; i < counterListSize; ++i) {
|
||||
const ServerInfo_CardCounter &counterInfo = info.counter_list(i);
|
||||
const ServerInfo_CardCounter &counterInfo = _info.counter_list(i);
|
||||
counters.insert(counterInfo.id(), counterInfo.value());
|
||||
}
|
||||
|
||||
setId(info.id());
|
||||
setName(QString::fromStdString(info.name()));
|
||||
setAttacking(info.attacking());
|
||||
setFaceDown(info.face_down());
|
||||
setPT(QString::fromStdString(info.pt()));
|
||||
setAnnotation(QString::fromStdString(info.annotation()));
|
||||
setColor(QString::fromStdString(info.color()));
|
||||
setTapped(info.tapped());
|
||||
setDestroyOnZoneChange(info.destroy_on_zone_change());
|
||||
setDoesntUntap(info.doesnt_untap());
|
||||
setId(_info.id());
|
||||
setName(QString::fromStdString(_info.name()));
|
||||
setAttacking(_info.attacking());
|
||||
setFaceDown(_info.face_down());
|
||||
setPT(QString::fromStdString(_info.pt()));
|
||||
setAnnotation(QString::fromStdString(_info.annotation()));
|
||||
setColor(QString::fromStdString(_info.color()));
|
||||
setTapped(_info.tapped());
|
||||
setDestroyOnZoneChange(_info.destroy_on_zone_change());
|
||||
setDoesntUntap(_info.doesnt_untap());
|
||||
}
|
||||
|
||||
CardDragItem *CardItem::createDragItem(int _id, const QPointF &_pos, const QPointF &_scenePos, bool faceDown)
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ public:
|
|||
return attachedCards;
|
||||
}
|
||||
void resetState();
|
||||
void processCardInfo(const ServerInfo_Card &info);
|
||||
void processCardInfo(const ServerInfo_Card &_info);
|
||||
|
||||
QMenu *getCardMenu() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ protected:
|
|||
const InnerDecklistNode *zoneNode,
|
||||
QList<DecklistCardNode *> cards,
|
||||
bool addComments = true);
|
||||
virtual QString getCardZoneFromName(QString cardName, QString currentZoneName);
|
||||
virtual QString getCompleteCardName(const QString &cardName) const;
|
||||
[[nodiscard]] QString getCardZoneFromName(QString cardName, QString currentZoneName) override;
|
||||
[[nodiscard]] QString getCompleteCardName(const QString &cardName) const override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -245,22 +245,22 @@ void DlgConnect::updateDisplayInfo(const QString &saveName)
|
|||
}
|
||||
|
||||
UserConnection_Information uci;
|
||||
QStringList data = uci.getServerInfo(saveName);
|
||||
QStringList _data = uci.getServerInfo(saveName);
|
||||
|
||||
bool savePasswordStatus = (data.at(5) == "1");
|
||||
bool savePasswordStatus = (_data.at(5) == "1");
|
||||
|
||||
saveEdit->setText(data.at(0));
|
||||
hostEdit->setText(data.at(1));
|
||||
portEdit->setText(data.at(2));
|
||||
playernameEdit->setText(data.at(3));
|
||||
saveEdit->setText(_data.at(0));
|
||||
hostEdit->setText(_data.at(1));
|
||||
portEdit->setText(_data.at(2));
|
||||
playernameEdit->setText(_data.at(3));
|
||||
savePasswordCheckBox->setChecked(savePasswordStatus);
|
||||
|
||||
if (savePasswordStatus) {
|
||||
passwordEdit->setText(data.at(4));
|
||||
passwordEdit->setText(_data.at(4));
|
||||
}
|
||||
|
||||
if (!data.at(6).isEmpty()) {
|
||||
QString formattedLink = "<a href=\"" + data.at(6) + "\">" + data.at(6) + "</a>";
|
||||
if (!_data.at(6).isEmpty()) {
|
||||
QString formattedLink = "<a href=\"" + _data.at(6) + "\">" + _data.at(6) + "</a>";
|
||||
serverContactLabel->setText(tr("Webpage") + ":");
|
||||
serverContactLink->setText(formattedLink);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -235,13 +235,13 @@ void DlgCreateGame::actOK()
|
|||
cmd.set_join_as_judge(QApplication::keyboardModifiers() & Qt::ShiftModifier);
|
||||
cmd.set_join_as_spectator(createGameAsSpectatorCheckBox->isChecked());
|
||||
|
||||
QString gameTypes = QString();
|
||||
QString _gameTypes = QString();
|
||||
QMapIterator<int, QRadioButton *> gameTypeCheckBoxIterator(gameTypeCheckBoxes);
|
||||
while (gameTypeCheckBoxIterator.hasNext()) {
|
||||
gameTypeCheckBoxIterator.next();
|
||||
if (gameTypeCheckBoxIterator.value()->isChecked()) {
|
||||
cmd.add_game_type_ids(gameTypeCheckBoxIterator.key());
|
||||
gameTypes += gameTypeCheckBoxIterator.value()->text() + ", ";
|
||||
_gameTypes += gameTypeCheckBoxIterator.value()->text() + ", ";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ void DlgCreateGame::actOK()
|
|||
SettingsCache::instance().setSpectatorsCanTalk(spectatorsCanTalkCheckBox->isChecked());
|
||||
SettingsCache::instance().setSpectatorsCanSeeEverything(spectatorsSeeEverythingCheckBox->isChecked());
|
||||
SettingsCache::instance().setCreateGameAsSpectator(createGameAsSpectatorCheckBox->isChecked());
|
||||
SettingsCache::instance().setGameTypes(gameTypes);
|
||||
SettingsCache::instance().setGameTypes(_gameTypes);
|
||||
}
|
||||
PendingCommand *pend = room->prepareRoomCommand(cmd);
|
||||
connect(pend, SIGNAL(finished(Response, CommandContainer, QVariant)), this, SLOT(checkResponse(Response)));
|
||||
|
|
|
|||
|
|
@ -1154,28 +1154,28 @@ ShortcutSettingsPage::ShortcutSettingsPage()
|
|||
btnClearAll->setIcon(QPixmap("theme:icons/clearsearch"));
|
||||
|
||||
// layout
|
||||
auto *editLayout = new QGridLayout;
|
||||
editLayout->addWidget(currentActionGroupLabel, 0, 0);
|
||||
editLayout->addWidget(currentActionGroupName, 0, 1);
|
||||
editLayout->addWidget(currentActionLabel, 1, 0);
|
||||
editLayout->addWidget(currentActionName, 1, 1);
|
||||
editLayout->addWidget(currentShortcutLabel, 2, 0);
|
||||
editLayout->addWidget(editTextBox, 2, 1);
|
||||
auto *_editLayout = new QGridLayout;
|
||||
_editLayout->addWidget(currentActionGroupLabel, 0, 0);
|
||||
_editLayout->addWidget(currentActionGroupName, 0, 1);
|
||||
_editLayout->addWidget(currentActionLabel, 1, 0);
|
||||
_editLayout->addWidget(currentActionName, 1, 1);
|
||||
_editLayout->addWidget(currentShortcutLabel, 2, 0);
|
||||
_editLayout->addWidget(editTextBox, 2, 1);
|
||||
|
||||
editShortcutGroupBox = new QGroupBox;
|
||||
editShortcutGroupBox->setLayout(editLayout);
|
||||
editShortcutGroupBox->setLayout(_editLayout);
|
||||
|
||||
auto *buttonsLayout = new QHBoxLayout;
|
||||
buttonsLayout->addWidget(faqLabel);
|
||||
buttonsLayout->addWidget(btnResetAll);
|
||||
buttonsLayout->addWidget(btnClearAll);
|
||||
auto *_buttonsLayout = new QHBoxLayout;
|
||||
_buttonsLayout->addWidget(faqLabel);
|
||||
_buttonsLayout->addWidget(btnResetAll);
|
||||
_buttonsLayout->addWidget(btnClearAll);
|
||||
|
||||
auto *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addWidget(shortcutsTable);
|
||||
mainLayout->addWidget(editShortcutGroupBox);
|
||||
mainLayout->addLayout(buttonsLayout);
|
||||
auto *_mainLayout = new QVBoxLayout;
|
||||
_mainLayout->addWidget(shortcutsTable);
|
||||
_mainLayout->addWidget(editShortcutGroupBox);
|
||||
_mainLayout->addLayout(_buttonsLayout);
|
||||
|
||||
setLayout(mainLayout);
|
||||
setLayout(_mainLayout);
|
||||
|
||||
connect(btnResetAll, SIGNAL(clicked()), this, SLOT(resetShortcuts()));
|
||||
connect(btnClearAll, SIGNAL(clicked()), this, SLOT(clearShortcuts()));
|
||||
|
|
|
|||
|
|
@ -212,22 +212,22 @@ bool PictureLoaderWorker::cardImageExistsOnDisk(QString &setName, QString &corre
|
|||
// Iterates through the list of paths, searching for images with the desired
|
||||
// name with any QImageReader-supported
|
||||
// extension
|
||||
for (const auto &picsPath : picsPaths) {
|
||||
imgReader.setFileName(picsPath);
|
||||
for (const auto &_picsPath : picsPaths) {
|
||||
imgReader.setFileName(_picsPath);
|
||||
if (imgReader.read(&image)) {
|
||||
qDebug().nospace() << "PictureLoader: [card: " << correctedCardname << " set: " << setName
|
||||
<< "]: Picture found on disk.";
|
||||
imageLoaded(cardBeingLoaded.getCard(), image);
|
||||
return true;
|
||||
}
|
||||
imgReader.setFileName(picsPath + ".full");
|
||||
imgReader.setFileName(_picsPath + ".full");
|
||||
if (imgReader.read(&image)) {
|
||||
qDebug().nospace() << "PictureLoader: [card: " << correctedCardname << " set: " << setName
|
||||
<< "]: Picture.full found on disk.";
|
||||
imageLoaded(cardBeingLoaded.getCard(), image);
|
||||
return true;
|
||||
}
|
||||
imgReader.setFileName(picsPath + ".xlhq");
|
||||
imgReader.setFileName(_picsPath + ".xlhq");
|
||||
if (imgReader.read(&image)) {
|
||||
qDebug().nospace() << "PictureLoader: [card: " << correctedCardname << " set: " << setName
|
||||
<< "]: Picture.xlhq found on disk.";
|
||||
|
|
|
|||
|
|
@ -126,12 +126,12 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
|
|||
qreal avatarMargin = (counterAreaWidth + CARD_HEIGHT + 15 - playerTarget->boundingRect().width()) / 2.0;
|
||||
playerTarget->setPos(QPointF(avatarMargin, avatarMargin));
|
||||
|
||||
PileZone *deck = new PileZone(this, "deck", true, false, playerArea);
|
||||
auto *_deck = new PileZone(this, "deck", true, false, playerArea);
|
||||
QPointF base = QPointF(counterAreaWidth + (CARD_HEIGHT - CARD_WIDTH + 15) / 2.0,
|
||||
10 + playerTarget->boundingRect().height() + 5 - (CARD_HEIGHT - CARD_WIDTH) / 2.0);
|
||||
deck->setPos(base);
|
||||
_deck->setPos(base);
|
||||
|
||||
qreal h = deck->boundingRect().width() + 5;
|
||||
qreal h = _deck->boundingRect().width() + 5;
|
||||
|
||||
auto *handCounter = new HandCounter(playerArea);
|
||||
handCounter->setPos(base + QPointF(0, h + 10));
|
||||
|
|
@ -321,7 +321,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
|
|||
bottomLibraryMenu = libraryMenu->addTearOffMenu(QString());
|
||||
libraryMenu->addSeparator();
|
||||
libraryMenu->addAction(aOpenDeckInDeckEditor);
|
||||
deck->setMenu(libraryMenu, aDrawCard);
|
||||
_deck->setMenu(libraryMenu, aDrawCard);
|
||||
|
||||
topLibraryMenu->addAction(aMoveTopToPlay);
|
||||
topLibraryMenu->addAction(aMoveTopToPlayFaceDown);
|
||||
|
|
@ -2282,27 +2282,27 @@ void Player::eventAttachCard(const Event_AttachCard &event)
|
|||
|
||||
void Player::eventDrawCards(const Event_DrawCards &event)
|
||||
{
|
||||
CardZone *deck = zones.value("deck");
|
||||
CardZone *hand = zones.value("hand");
|
||||
CardZone *_deck = zones.value("deck");
|
||||
CardZone *_hand = zones.value("hand");
|
||||
|
||||
const int listSize = event.cards_size();
|
||||
if (listSize) {
|
||||
for (int i = 0; i < listSize; ++i) {
|
||||
const ServerInfo_Card &cardInfo = event.cards(i);
|
||||
CardItem *card = deck->takeCard(0, cardInfo.id());
|
||||
CardItem *card = _deck->takeCard(0, cardInfo.id());
|
||||
card->setName(QString::fromStdString(cardInfo.name()));
|
||||
hand->addCard(card, false, -1);
|
||||
_hand->addCard(card, false, -1);
|
||||
}
|
||||
} else {
|
||||
const int number = event.number();
|
||||
for (int i = 0; i < number; ++i) {
|
||||
hand->addCard(deck->takeCard(0, -1), false, -1);
|
||||
_hand->addCard(_deck->takeCard(0, -1), false, -1);
|
||||
}
|
||||
}
|
||||
|
||||
hand->reorganizeCards();
|
||||
deck->reorganizeCards();
|
||||
emit logDrawCards(this, event.number(), deck->getCards().size() == 0);
|
||||
_hand->reorganizeCards();
|
||||
_deck->reorganizeCards();
|
||||
emit logDrawCards(this, event.number(), _deck->getCards().size() == 0);
|
||||
}
|
||||
|
||||
void Player::eventRevealCards(const Event_RevealCards &event)
|
||||
|
|
@ -3157,16 +3157,16 @@ void Player::actSetPT()
|
|||
if (!empty) {
|
||||
const auto oldpt = parsePT(card->getPT());
|
||||
int ptIter = 0;
|
||||
for (const auto &item : ptList) {
|
||||
for (const auto &_item : ptList) {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
if (item.typeId() == QMetaType::Type::Int) {
|
||||
if (_item.typeId() == QMetaType::Type::Int) {
|
||||
#else
|
||||
if (item.type() == QVariant::Int) {
|
||||
if (_item.type() == QVariant::Int) {
|
||||
#endif
|
||||
int oldItem = ptIter < oldpt.size() ? oldpt.at(ptIter).toInt() : 0;
|
||||
newpt += '/' + QString::number(oldItem + item.toInt());
|
||||
newpt += '/' + QString::number(oldItem + _item.toInt());
|
||||
} else {
|
||||
newpt += '/' + item.toString();
|
||||
newpt += '/' + _item.toString();
|
||||
}
|
||||
++ptIter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,16 +218,16 @@ ServerInfo_Replay const *RemoteReplayList_TreeModel::getReplay(const QModelIndex
|
|||
ServerInfo_ReplayMatch const *RemoteReplayList_TreeModel::getReplayMatch(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
MatchNode *node = dynamic_cast<MatchNode *>(static_cast<Node *>(index.internalPointer()));
|
||||
auto *node = dynamic_cast<MatchNode *>(static_cast<Node *>(index.internalPointer()));
|
||||
if (!node) {
|
||||
ReplayNode *node = dynamic_cast<ReplayNode *>(static_cast<Node *>(index.internalPointer()));
|
||||
if (!node)
|
||||
return 0;
|
||||
return &node->getParent()->getMatchInfo();
|
||||
} else
|
||||
return &node->getMatchInfo();
|
||||
auto *_node = dynamic_cast<ReplayNode *>(static_cast<Node *>(index.internalPointer()));
|
||||
if (!_node)
|
||||
return nullptr;
|
||||
return &_node->getParent()->getMatchInfo();
|
||||
}
|
||||
return &node->getMatchInfo();
|
||||
}
|
||||
|
||||
void RemoteReplayList_TreeModel::clearTree()
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ void SequenceEdit::removeLastShortcut()
|
|||
QString sequences = lineEdit->text();
|
||||
if (!sequences.isEmpty()) {
|
||||
if (sequences.lastIndexOf(";") > 0) {
|
||||
QString valid = sequences.left(sequences.lastIndexOf(";"));
|
||||
lineEdit->setText(valid);
|
||||
QString validText = sequences.left(sequences.lastIndexOf(";"));
|
||||
lineEdit->setText(validText);
|
||||
} else {
|
||||
lineEdit->clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1076,8 +1076,8 @@ void TabDeckEditor::actDecrementCardFromSideboard()
|
|||
|
||||
void TabDeckEditor::copyDatabaseCellContents()
|
||||
{
|
||||
QVariant data = databaseView->selectionModel()->currentIndex().data();
|
||||
QApplication::clipboard()->setText(data.toString());
|
||||
auto _data = databaseView->selectionModel()->currentIndex().data();
|
||||
QApplication::clipboard()->setText(_data.toString());
|
||||
}
|
||||
|
||||
void TabDeckEditor::actIncrement()
|
||||
|
|
|
|||
|
|
@ -986,7 +986,7 @@ PendingCommand *TabGame::prepareGameCommand(const QList<const ::google::protobuf
|
|||
return new PendingCommand(cont);
|
||||
}
|
||||
|
||||
void TabGame::startGame(bool resuming)
|
||||
void TabGame::startGame(bool _resuming)
|
||||
{
|
||||
currentPhase = -1;
|
||||
|
||||
|
|
@ -999,7 +999,7 @@ void TabGame::startGame(bool resuming)
|
|||
|
||||
mainWidget->setCurrentWidget(gamePlayAreaWidget);
|
||||
|
||||
if (!resuming) {
|
||||
if (!_resuming) {
|
||||
QMapIterator<int, Player *> playerIterator(players);
|
||||
while (playerIterator.hasNext())
|
||||
playerIterator.next().value()->setGameStarted();
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ void TabLog::getClicked()
|
|||
if (maximumResults->value() == 0)
|
||||
maximumResults->setValue(1000);
|
||||
|
||||
int dateRange;
|
||||
int dateRange = 0;
|
||||
if (lastHour->isChecked())
|
||||
dateRange = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -134,11 +134,11 @@ void TabReplays::actOpenLocalReplay()
|
|||
QFile f(filePath);
|
||||
if (!f.open(QIODevice::ReadOnly))
|
||||
return;
|
||||
QByteArray data = f.readAll();
|
||||
QByteArray _data = f.readAll();
|
||||
f.close();
|
||||
|
||||
GameReplay *replay = new GameReplay;
|
||||
replay->ParseFromArray(data.data(), data.size());
|
||||
replay->ParseFromArray(_data.data(), _data.size());
|
||||
|
||||
emit openReplay(replay);
|
||||
}
|
||||
|
|
@ -223,10 +223,10 @@ void TabReplays::downloadFinished(const Response &r,
|
|||
const Response_ReplayDownload &resp = r.GetExtension(Response_ReplayDownload::ext);
|
||||
QString filePath = extraData.toString();
|
||||
|
||||
const std::string &data = resp.replay_data();
|
||||
const std::string &_data = resp.replay_data();
|
||||
QFile f(filePath);
|
||||
f.open(QIODevice::WriteOnly);
|
||||
f.write((const char *)data.data(), data.size());
|
||||
f.write((const char *)_data.data(), _data.size());
|
||||
f.close();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -729,8 +729,8 @@ const ServerInfo_User *TabSupervisor::getOnlineUser(const QString &userName) con
|
|||
|
||||
for (i = userList.begin(); i != userList.end(); ++i)
|
||||
if (i.key().toLower() == userNameToMatchLower) {
|
||||
const ServerInfo_User &userInfo = i.value()->getUserInfo();
|
||||
return &userInfo;
|
||||
const ServerInfo_User &_userInfo = i.value()->getUserInfo();
|
||||
return &_userInfo;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
|
|
|||
|
|
@ -306,10 +306,10 @@ void UserContextMenu::showContextMenu(const QPoint &pos,
|
|||
const QString &deckHash,
|
||||
ChatView *chatView)
|
||||
{
|
||||
QAction *aCopyToClipBoard, *aRemoveMessages;
|
||||
QAction *aCopyToClipBoard = nullptr, *aRemoveMessages = nullptr;
|
||||
aUserName->setText(userName);
|
||||
|
||||
QMenu *menu = new QMenu(static_cast<QWidget *>(parent()));
|
||||
auto *menu = new QMenu(static_cast<QWidget *>(parent()));
|
||||
menu->addAction(aUserName);
|
||||
menu->addSeparator();
|
||||
if (!deckHash.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -28,16 +28,16 @@ QMap<QString, std::pair<QString, UserConnection_Information>> UserConnection_Inf
|
|||
int size = servers.getValue("totalServers", "server", "server_details").toInt() + 1;
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
QString saveName = servers.getValue(QString("saveName%1").arg(i), "server", "server_details").toString();
|
||||
QString _saveName = servers.getValue(QString("saveName%1").arg(i), "server", "server_details").toString();
|
||||
QString serverName = servers.getValue(QString("server%1").arg(i), "server", "server_details").toString();
|
||||
QString portNum = servers.getValue(QString("port%1").arg(i), "server", "server_details").toString();
|
||||
QString userName = servers.getValue(QString("username%1").arg(i), "server", "server_details").toString();
|
||||
QString pass = servers.getValue(QString("password%1").arg(i), "server", "server_details").toString();
|
||||
bool savePass = servers.getValue(QString("savePassword%1").arg(i), "server", "server_details").toBool();
|
||||
QString site = servers.getValue(QString("site%1").arg(i), "server", "server_details").toString();
|
||||
QString _site = servers.getValue(QString("site%1").arg(i), "server", "server_details").toString();
|
||||
|
||||
UserConnection_Information userInfo(saveName, serverName, portNum, userName, pass, savePass, site);
|
||||
serverList.insert(saveName, std::make_pair(serverName, userInfo));
|
||||
UserConnection_Information userInfo(_saveName, serverName, portNum, userName, pass, savePass, _site);
|
||||
serverList.insert(_saveName, std::make_pair(serverName, userInfo));
|
||||
}
|
||||
|
||||
return serverList;
|
||||
|
|
@ -45,15 +45,15 @@ QMap<QString, std::pair<QString, UserConnection_Information>> UserConnection_Inf
|
|||
|
||||
QStringList UserConnection_Information::getServerInfo(const QString &find)
|
||||
{
|
||||
QStringList server;
|
||||
QStringList _server;
|
||||
|
||||
ServersSettings &servers = SettingsCache::instance().servers();
|
||||
|
||||
int size = servers.getValue("totalServers", "server", "server_details").toInt() + 1;
|
||||
for (int i = 0; i < size; i++) {
|
||||
QString saveName = servers.getValue(QString("saveName%1").arg(i), "server", "server_details").toString();
|
||||
QString _saveName = servers.getValue(QString("saveName%1").arg(i), "server", "server_details").toString();
|
||||
|
||||
if (find != saveName)
|
||||
if (find != _saveName)
|
||||
continue;
|
||||
|
||||
QString serverName = servers.getValue(QString("server%1").arg(i), "server", "server_details").toString();
|
||||
|
|
@ -61,20 +61,20 @@ QStringList UserConnection_Information::getServerInfo(const QString &find)
|
|||
QString userName = servers.getValue(QString("username%1").arg(i), "server", "server_details").toString();
|
||||
QString pass = servers.getValue(QString("password%1").arg(i), "server", "server_details").toString();
|
||||
bool savePass = servers.getValue(QString("savePassword%1").arg(i), "server", "server_details").toBool();
|
||||
QString site = servers.getValue(QString("site%1").arg(i), "server", "server_details").toString();
|
||||
QString _site = servers.getValue(QString("site%1").arg(i), "server", "server_details").toString();
|
||||
|
||||
server.append(saveName);
|
||||
server.append(serverName);
|
||||
server.append(portNum);
|
||||
server.append(userName);
|
||||
server.append(pass);
|
||||
server.append(savePass ? "1" : "0");
|
||||
server.append(site);
|
||||
_server.append(_saveName);
|
||||
_server.append(serverName);
|
||||
_server.append(portNum);
|
||||
_server.append(userName);
|
||||
_server.append(pass);
|
||||
_server.append(savePass ? "1" : "0");
|
||||
_server.append(_site);
|
||||
break;
|
||||
}
|
||||
|
||||
if (server.empty())
|
||||
if (_server.empty())
|
||||
qDebug() << "There was a problem!";
|
||||
|
||||
return server;
|
||||
return _server;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue