Fix QString missing arg warning in logMoveCard (#5992)
Some checks failed
Build Desktop / Configure (push) Has been cancelled
Build Docker Image / amd64 & arm64 (push) Has been cancelled
Build Web / React (Node ${{matrix.node_version}}) (16) (push) Has been cancelled
Build Web / React (Node ${{matrix.node_version}}) (lts/*) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, 12) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, skip, 11) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, 42) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, skip, 41) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, 24.04) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, skip, 22.04) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (yes, Arch, skip) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (1, macos-13, Intel, 13, Release, 14.3.1) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (1, macos-14, Apple, 14, Release, 15.4) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (1, macos-15, Apple, 15, Release, 16.2) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (macos-15, Apple, 15, Debug, 16.2) (push) Has been cancelled
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, 5.15.*, 7) (push) Has been cancelled
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, qtimageformats qtmultimedia qtwebsockets, 6.6.*, 10) (push) Has been cancelled

This commit is contained in:
RickyRister
2025-06-14 08:11:00 -07:00
committed by GitHub
parent 61a6b32137
commit d42bfa88e1

View File

@@ -293,7 +293,7 @@ void MessageLogWidget::logMoveCard(Player *player,
}
QString finalStr;
bool usesNewX = false;
std::optional<QString> fourthArg;
if (targetZoneName == TABLE_ZONE_NAME) {
soundEngine->playSound("play_card");
if (card->getFaceDown()) {
@@ -316,7 +316,7 @@ void MessageLogWidget::logMoveCard(Player *player,
finalStr = tr("%1 puts %2%3 on top of their library.");
} else {
++newX;
usesNewX = true;
fourthArg = QString::number(newX);
finalStr = tr("%1 puts %2%3 into their library %4 cards from the top.");
}
} else if (targetZoneName == SIDEBOARD_ZONE_NAME) {
@@ -325,16 +325,17 @@ void MessageLogWidget::logMoveCard(Player *player,
soundEngine->playSound("play_card");
finalStr = tr("%1 plays %2%3.");
} else {
fourthArg = targetZoneName;
finalStr = tr("%1 moves %2%3 to custom zone '%4'.");
}
if (usesNewX) {
appendHtmlServerMessage(
finalStr.arg(sanitizeHtml(player->getName())).arg(cardStr).arg(nameFrom.second).arg(newX));
} else {
appendHtmlServerMessage(
finalStr.arg(sanitizeHtml(player->getName())).arg(cardStr).arg(nameFrom.second).arg(targetZoneName));
QString message = finalStr.arg(sanitizeHtml(player->getName()), cardStr, nameFrom.second);
if (fourthArg.has_value()) {
message = message.arg(fourthArg.value());
}
appendHtmlServerMessage(message);
}
void MessageLogWidget::logDrawCards(Player *player, int number, bool deckIsEmpty)