mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Rework the way sets selection/importing works; fix #539 (rebased)
This commit is contained in:
parent
e69ca60164
commit
881cea27f4
13 changed files with 369 additions and 162 deletions
|
|
@ -32,7 +32,6 @@ bool OracleImporter::readSetsFromByteArray(const QByteArray &data)
|
|||
QVariant editionCards;
|
||||
QString setType;
|
||||
QDate releaseDate;
|
||||
bool import;
|
||||
|
||||
while (it.hasNext()) {
|
||||
map = it.next().toMap();
|
||||
|
|
@ -45,11 +44,7 @@ bool OracleImporter::readSetsFromByteArray(const QByteArray &data)
|
|||
setType[0] = setType[0].toUpper();
|
||||
releaseDate = map.value("releaseDate").toDate();
|
||||
|
||||
// core and expansion sets are marked to be imported by default
|
||||
import = (0 == QString::compare(setType, QString("core"), Qt::CaseInsensitive) ||
|
||||
0 == QString::compare(setType, QString("expansion"), Qt::CaseInsensitive));
|
||||
|
||||
newSetList.append(SetToDownload(edition, editionLong, editionCards, import, setType, releaseDate));
|
||||
newSetList.append(SetToDownload(edition, editionLong, editionCards, setType, releaseDate));
|
||||
}
|
||||
|
||||
qSort(newSetList);
|
||||
|
|
@ -265,10 +260,7 @@ int OracleImporter::startImport()
|
|||
|
||||
while (it.hasNext())
|
||||
{
|
||||
curSet = & it.next();
|
||||
if(!curSet->getImport())
|
||||
continue;
|
||||
|
||||
curSet = & it.next();
|
||||
CardSet *set = new CardSet(curSet->getShortName(), curSet->getLongName(), curSet->getSetType(), curSet->getReleaseDate());
|
||||
if (!sets.contains(set->getShortName()))
|
||||
sets.insert(set->getShortName(), set);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue