mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-11 20:43:25 -08:00
Merge upstream/master into scryfall-tagger-tags
Conflict resolution: keep both the tag database and the upstream database writer in the oracle test targets and both includes in the importer test; restore the tags.svg resource entry that the rerere replay dropped. Upstream's icon rules also landed mid-branch: use loadThemedIcon() for the tag quick-filter button and re-author tags.svg as a 24x24 currentColor icon so IconAssets.AssetsFollowTheRules passes.
This commit is contained in:
commit
f154335f5c
553 changed files with 21045 additions and 11980 deletions
|
|
@ -316,6 +316,10 @@ void CardInfo::setColors(const QString &value)
|
|||
{
|
||||
setProperty(Mtg::Colors, value);
|
||||
}
|
||||
QString CardInfo::getColorIdentity() const
|
||||
{
|
||||
return getProperty(Mtg::ColorIdentity);
|
||||
}
|
||||
QString CardInfo::getLoyalty() const
|
||||
{
|
||||
return getProperty(Mtg::Loyalty);
|
||||
|
|
|
|||
|
|
@ -469,6 +469,7 @@ public:
|
|||
[[nodiscard]] QString getCmc() const;
|
||||
[[nodiscard]] QString getColors() const;
|
||||
void setColors(const QString &value);
|
||||
[[nodiscard]] QString getColorIdentity() const;
|
||||
[[nodiscard]] QString getLoyalty() const;
|
||||
[[nodiscard]] QString getMainCardType() const;
|
||||
[[nodiscard]] QString getManaCost() const;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ LoadStatus CardDatabaseLoader::loadCardDatabase(const QString &path, CardDatabas
|
|||
auto startTime = QTime::currentTime();
|
||||
LoadStatus tempLoadStatus = NotLoaded;
|
||||
if (!path.isEmpty()) {
|
||||
QMutexLocker locker(loadFromFileMutex);
|
||||
QMutexLocker locker(&loadFromFileMutex);
|
||||
tempLoadStatus = loadFromFile(path, data);
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ LoadStatus CardDatabaseLoader::loadCardDatabases(bool ignoreCache)
|
|||
|
||||
LoadStatus CardDatabaseLoader::doLoadCardDatabases(bool ignoreCache)
|
||||
{
|
||||
QMutexLocker locker(reloadDatabaseMutex);
|
||||
QMutexLocker locker(&reloadDatabaseMutex);
|
||||
|
||||
if (!database) {
|
||||
qCWarning(CardDatabaseLoadingLog) << "Loader has no database pointer";
|
||||
|
|
|
|||
|
|
@ -177,8 +177,8 @@ private:
|
|||
ICardSetPriorityController *priorityController; /**< Controller for reconstructing set state. */
|
||||
QList<ICardDatabaseParser *> availableParsers; /**< List of available parsers for different formats. */
|
||||
|
||||
QBasicMutex *loadFromFileMutex = new QBasicMutex(); /**< Mutex for single-file loading. */
|
||||
QBasicMutex *reloadDatabaseMutex = new QBasicMutex(); /**< Mutex for reloading entire database. */
|
||||
QBasicMutex loadFromFileMutex; /**< Mutex for single-file loading. */
|
||||
QBasicMutex reloadDatabaseMutex; /**< Mutex for reloading entire database. */
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_CARD_DATABASE_LOADER_H
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include <QIODevice>
|
||||
#include <QList>
|
||||
#include <QMessageLogger>
|
||||
#include <QSaveFile>
|
||||
#include <QSharedPointer>
|
||||
#include <QStringView>
|
||||
#include <QXmlStreamAttributes>
|
||||
|
|
@ -32,7 +33,7 @@ class ICardSetPriorityController;
|
|||
#define COCKATRICE_XML3_TAGNAME "cockatrice_carddatabase"
|
||||
#define COCKATRICE_XML3_TAGVER 3
|
||||
#define COCKATRICE_XML3_SCHEMALOCATION \
|
||||
"https://raw.githubusercontent.com/Cockatrice/Cockatrice/master/doc/carddatabase_v3/cards.xsd"
|
||||
"https://raw.githubusercontent.com/Cockatrice/Cockatrice/master/docs/xsd/cards_v3.xsd"
|
||||
|
||||
CockatriceXml3Parser::CockatriceXml3Parser(ICardSetPriorityController *_cardSetPriorityController)
|
||||
: ICardDatabaseParser(_cardSetPriorityController)
|
||||
|
|
@ -499,7 +500,7 @@ bool CockatriceXml3Parser::saveToFile(FormatRulesNameMap _formats,
|
|||
{
|
||||
Q_UNUSED(_formats);
|
||||
|
||||
QFile file(fileName);
|
||||
QSaveFile file(fileName);
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -539,5 +540,5 @@ bool CockatriceXml3Parser::saveToFile(FormatRulesNameMap _formats,
|
|||
xml.writeEndElement(); // cockatrice_carddatabase
|
||||
xml.writeEndDocument();
|
||||
|
||||
return true;
|
||||
return !xml.hasError() && file.commit();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QMessageLogger>
|
||||
#include <QSaveFile>
|
||||
#include <QSharedPointer>
|
||||
#include <QStringList>
|
||||
#include <QStringView>
|
||||
|
|
@ -35,7 +36,7 @@ class ICardSetPriorityController;
|
|||
#define COCKATRICE_XML4_TAGNAME "cockatrice_carddatabase"
|
||||
#define COCKATRICE_XML4_TAGVER 4
|
||||
#define COCKATRICE_XML4_SCHEMALOCATION \
|
||||
"https://raw.githubusercontent.com/Cockatrice/Cockatrice/master/doc/carddatabase_v4/cards.xsd"
|
||||
"https://raw.githubusercontent.com/Cockatrice/Cockatrice/master/docs/xsd/cards.xsd"
|
||||
|
||||
CockatriceXml4Parser::CockatriceXml4Parser(ICardSetPriorityController *_cardSetPriorityController)
|
||||
: ICardDatabaseParser(_cardSetPriorityController)
|
||||
|
|
@ -682,7 +683,7 @@ bool CockatriceXml4Parser::saveToFile(FormatRulesNameMap _formats,
|
|||
const QString &sourceUrl,
|
||||
const QString &sourceVersion)
|
||||
{
|
||||
QFile file(fileName);
|
||||
QSaveFile file(fileName);
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -730,5 +731,5 @@ bool CockatriceXml4Parser::saveToFile(FormatRulesNameMap _formats,
|
|||
xml.writeEndElement(); // cockatrice_carddatabase
|
||||
xml.writeEndDocument();
|
||||
|
||||
return true;
|
||||
return !xml.hasError() && file.commit();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue