[DeckSync] Address tombstone review nits: log category and designated initializer

This commit is contained in:
Lukas Brübach 2026-11-06 09:15:28 +01:00
parent a94db4171b
commit b9270ecbeb

View file

@ -8,6 +8,7 @@
#include <QDirIterator>
#include <QFile>
#include <QFileInfo>
#include <QLoggingCategory>
#include <QSaveFile>
#include <QStringList>
#include <QUuid>
@ -27,6 +28,8 @@
#include <libcockatrice/protocol/pending_command.h>
#include <libcockatrice/utility/string_limits.h>
inline Q_LOGGING_CATEGORY(DeckSyncLog, "deck_sync");
namespace
{
constexpr const char *SYNC_META_DIR = ".sync";
@ -492,11 +495,11 @@ void DeckSyncManager::onUploadFinished(const Response &response,
if (response.response_code() == Response::RespNameNotFound && deckId != -1) {
// The server row is gone (purged tombstone or removed elsewhere):
// upload the deck as new instead of updating a dead id.
UploadOp retry;
retry.relativePath = relativePath;
retry.serverPath = context.value("serverPath").toString();
retry.deckId = -1;
retry.guid = context.value("guid").toString();
const UploadOp retry{.relativePath = relativePath,
.serverPath = context.value("serverPath").toString(),
.serverDir = {},
.deckId = -1,
.guid = context.value("guid").toString()};
pendingUploads.prepend(retry);
processNext();
return;
@ -693,7 +696,7 @@ void DeckSyncManager::snapshotLocalFile(const QString &relativePath, const QStri
}
snapshot.write(source.readAll());
if (!snapshot.commit()) {
qWarning() << "DeckSync: could not write the base snapshot for" << relativePath;
qCWarning(DeckSyncLog) << "DeckSync: could not write the base snapshot for" << relativePath;
}
}