mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 15:49:28 -08:00
[Oracle] Use NoOp setting providers (#6312)
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
#include "oracleimporter.h"
|
#include "oracleimporter.h"
|
||||||
|
|
||||||
#include "client/settings/cache_settings.h"
|
#include "client/settings/cache_settings.h"
|
||||||
|
#include "libcockatrice/interfaces/noop_card_preference_provider.h"
|
||||||
|
#include "libcockatrice/interfaces/noop_card_set_priority_controller.h"
|
||||||
#include "parsehelpers.h"
|
#include "parsehelpers.h"
|
||||||
#include "qt-json/json.h"
|
#include "qt-json/json.h"
|
||||||
|
|
||||||
@@ -8,7 +10,6 @@
|
|||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <database/interface/settings_card_preference_provider.h>
|
|
||||||
#include <libcockatrice/card/database/parser/cockatrice_xml_4.h>
|
#include <libcockatrice/card/database/parser/cockatrice_xml_4.h>
|
||||||
#include <libcockatrice/card/relation/card_relation.h>
|
#include <libcockatrice/card/relation/card_relation.h>
|
||||||
|
|
||||||
@@ -457,14 +458,17 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
|||||||
|
|
||||||
int OracleImporter::startImport()
|
int OracleImporter::startImport()
|
||||||
{
|
{
|
||||||
int setIndex = 0;
|
static ICardSetPriorityController *noOpController = new NoopCardSetPriorityController();
|
||||||
|
|
||||||
// add an empty set for tokens
|
// add an empty set for tokens
|
||||||
CardSetPtr tokenSet = CardSet::newInstance(SettingsCache::instance().cardDatabase(), CardSet::TOKENS_SETNAME,
|
CardSetPtr tokenSet =
|
||||||
tr("Dummy set containing tokens"), "Tokens");
|
CardSet::newInstance(noOpController, CardSet::TOKENS_SETNAME, tr("Dummy set containing tokens"), "Tokens");
|
||||||
sets.insert(CardSet::TOKENS_SETNAME, tokenSet);
|
sets.insert(CardSet::TOKENS_SETNAME, tokenSet);
|
||||||
|
|
||||||
|
int setIndex = 0;
|
||||||
|
|
||||||
for (const SetToDownload &curSetToParse : allSets) {
|
for (const SetToDownload &curSetToParse : allSets) {
|
||||||
CardSetPtr newSet = CardSet::newInstance(SettingsCache::instance().cardDatabase(), curSetToParse.getShortName(),
|
CardSetPtr newSet = CardSet::newInstance(noOpController, curSetToParse.getShortName(),
|
||||||
curSetToParse.getLongName(), curSetToParse.getSetType(),
|
curSetToParse.getLongName(), curSetToParse.getSetType(),
|
||||||
curSetToParse.getReleaseDate(), curSetToParse.getPriority());
|
curSetToParse.getReleaseDate(), curSetToParse.getPriority());
|
||||||
if (!sets.contains(newSet->getShortName()))
|
if (!sets.contains(newSet->getShortName()))
|
||||||
@@ -485,7 +489,7 @@ int OracleImporter::startImport()
|
|||||||
|
|
||||||
bool OracleImporter::saveToFile(const QString &fileName, const QString &sourceUrl, const QString &sourceVersion)
|
bool OracleImporter::saveToFile(const QString &fileName, const QString &sourceUrl, const QString &sourceVersion)
|
||||||
{
|
{
|
||||||
CockatriceXml4Parser parser(new SettingsCardPreferenceProvider());
|
CockatriceXml4Parser parser(new NoopCardPreferenceProvider());
|
||||||
return parser.saveToFile(sets, cards, fileName, sourceUrl, sourceVersion);
|
return parser.saveToFile(sets, cards, fileName, sourceUrl, sourceVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user