Cockatrice/libcockatrice_card/libcockatrice/card/printing/printing_info.cpp
Lukas Brübach 1057d2eb3b [Card Database] Improve loading times through binary cache
Took 10 minutes


Took 9 minutes

Took 16 seconds
2026-07-27 14:05:44 +02:00

37 lines
No EOL
828 B
C++

#include "printing_info.h"
#include "../set/card_set.h"
#include <QDataStream>
PrintingInfo::PrintingInfo(const CardSetPtr &_set) : set(_set)
{
}
void PrintingInfo::ensurePropertiesLoaded() const
{
QMutexLocker lock(propertiesMutex.data());
if (propertiesLoaded) {
return;
}
propertiesCache.clear();
if (!propertiesBlob.isEmpty()) {
QDataStream in(propertiesBlob);
in.setVersion(QDataStream::Qt_6_5);
in >> propertiesCache;
}
propertiesLoaded = true;
}
/**
* Gets the uuid property of the printing, or an empty string if the property isn't present
*/
QString PrintingInfo::getUuid() const
{
return getPropertiesHash().value("uuid").toString();
}
QString PrintingInfo::getFlavorName() const
{
return getPropertiesHash().value("flavorName").toString();
}