diff --git a/cockatrice/src/interface/deck_sync/deck_sync_profile.h b/cockatrice/src/interface/deck_sync/deck_sync_profile.h index dff61a943..ac63ab913 100644 --- a/cockatrice/src/interface/deck_sync/deck_sync_profile.h +++ b/cockatrice/src/interface/deck_sync/deck_sync_profile.h @@ -9,16 +9,15 @@ #include /** - * @class DeckSyncProfile + * @struct DeckSyncProfile * @brief Identifies which server and login a sync sidecar belongs to. * * A local deck folder can sync against several servers. Every server login * gets its own profile, and every profile gets its own sidecar file, so * switching servers never mixes up remote deck ids. */ -class DeckSyncProfile +struct DeckSyncProfile { -public: QString host; ///< Server hostname as entered by the user. int port = 0; ///< Server port. QString username; ///< Login name on that server. diff --git a/cockatrice/src/interface/deck_sync/deck_sync_sidecar.cpp b/cockatrice/src/interface/deck_sync/deck_sync_sidecar.cpp index 2e3a5ba49..9e2785f41 100644 --- a/cockatrice/src/interface/deck_sync/deck_sync_sidecar.cpp +++ b/cockatrice/src/interface/deck_sync/deck_sync_sidecar.cpp @@ -37,12 +37,11 @@ bool DeckSyncSidecar::load() continue; } const QJsonObject entry = it.value().toObject(); - DeckSyncRecord record; - record.guid = entry.value("guid").toString(); - record.remoteId = entry.value("remoteId").toInt(-1); - record.baseHash = entry.value("baseHash").toString(); - record.lastSyncSecs = static_cast(entry.value("lastSync").toDouble()); - record.deleted = entry.value("deleted").toBool(false); + const DeckSyncRecord record{.guid = entry.value("guid").toString(), + .remoteId = entry.value("remoteId").toInt(-1), + .baseHash = entry.value("baseHash").toString(), + .lastSyncSecs = static_cast(entry.value("lastSync").toDouble()), + .deleted = entry.value("deleted").toBool(false)}; recordMap.insert(it.key(), record); } return true; diff --git a/libcockatrice_deck_list/libcockatrice/deck_list/deck_diff.cpp b/libcockatrice_deck_list/libcockatrice/deck_list/deck_diff.cpp index 538de57e8..5024010b2 100644 --- a/libcockatrice_deck_list/libcockatrice/deck_list/deck_diff.cpp +++ b/libcockatrice_deck_list/libcockatrice/deck_list/deck_diff.cpp @@ -70,14 +70,13 @@ DeckDiffResult diff(const DeckList &oldDeck, const DeckList &newDeck) const int oldCount = oldCounts.value(key, 0); const ZoneCardInfo newInfo = newInfos.value(key, ZoneCardInfo()); if (oldCount != newInfo.count) { - DeckCardChange change; - change.zone = key.first; - change.cardName = key.second; - change.oldCount = oldCount; - change.newCount = newInfo.count; - change.cardSetShortName = newInfo.cardSetShortName; - change.cardSetNumber = newInfo.cardSetNumber; - change.cardProviderId = newInfo.cardProviderId; + const DeckCardChange change{.zone = key.first, + .cardName = key.second, + .oldCount = oldCount, + .newCount = newInfo.count, + .cardSetShortName = newInfo.cardSetShortName, + .cardSetNumber = newInfo.cardSetNumber, + .cardProviderId = newInfo.cardProviderId}; result.changes.append(change); } }