mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-07 18:43:26 -08:00
Compare commits
22 commits
6d67b76fa3
...
875e87d1bc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
875e87d1bc | ||
|
|
8bb0a9b98a | ||
|
|
e73fcd602c | ||
|
|
dcccb0f332 | ||
|
|
9e4d734373 | ||
|
|
d2e2e722e7 | ||
|
|
de3468cc33 | ||
|
|
157e63b179 | ||
|
|
e43862c3bc | ||
|
|
2916fa45af | ||
|
|
ad0da98a86 | ||
|
|
c0a62a2486 | ||
|
|
0757d3d867 | ||
|
|
8a541531da | ||
|
|
e1a9f7766d | ||
|
|
ad1cb8f133 | ||
|
|
e63b72fe11 | ||
|
|
fa4c5766eb | ||
|
|
15673dc481 | ||
|
|
da106fdef7 | ||
|
|
f661468069 | ||
|
|
be072ffd68 |
3 changed files with 17 additions and 14 deletions
|
|
@ -9,15 +9,16 @@
|
|||
#include <QString>
|
||||
|
||||
/**
|
||||
* @struct DeckSyncProfile
|
||||
* @class 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.
|
||||
*/
|
||||
struct DeckSyncProfile
|
||||
class DeckSyncProfile
|
||||
{
|
||||
public:
|
||||
QString host; ///< Server hostname as entered by the user.
|
||||
int port = 0; ///< Server port.
|
||||
QString username; ///< Login name on that server.
|
||||
|
|
|
|||
|
|
@ -47,11 +47,12 @@ bool DeckSyncSidecar::load()
|
|||
continue;
|
||||
}
|
||||
const QJsonObject entry = it.value().toObject();
|
||||
const DeckSyncRecord record{.guid = entry.value("guid").toString(),
|
||||
.remoteId = entry.value("remoteId").toInt(-1),
|
||||
.baseHash = entry.value("baseHash").toString(),
|
||||
.lastSyncSecs = static_cast<qint64>(entry.value("lastSync").toDouble()),
|
||||
.deleted = entry.value("deleted").toBool(false)};
|
||||
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<qint64>(entry.value("lastSync").toDouble());
|
||||
record.deleted = entry.value("deleted").toBool(false);
|
||||
recordMap.insert(it.key(), record);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -70,13 +70,14 @@ 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) {
|
||||
const DeckCardChange change{.zone = key.first,
|
||||
.cardName = key.second,
|
||||
.oldCount = oldCount,
|
||||
.newCount = newInfo.count,
|
||||
.cardSetShortName = newInfo.cardSetShortName,
|
||||
.cardSetNumber = newInfo.cardSetNumber,
|
||||
.cardProviderId = newInfo.cardProviderId};
|
||||
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;
|
||||
result.changes.append(change);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue