Improve sets handling

Move the “check unknown sets” method inside the cards database, so that
it can be executed when the card database gets reloaded after a card
database update.
Additionally, show the user a welcome message the first time they run a
new cockatrice version, so that they know why they get shown the “edit
sets” window and how to hide/disable sets.
This commit is contained in:
Fabio Bas 2015-05-01 18:55:14 +02:00
parent c356a6fc48
commit 66adeb6d75
4 changed files with 59 additions and 35 deletions

View file

@ -232,12 +232,14 @@ protected:
QThread *pictureLoaderThread;
PictureLoader *pictureLoader;
LoadStatus loadStatus;
bool detectedFirstRun;
private:
static const int versionNeeded;
void loadCardsFromXml(QXmlStreamReader &xml, bool tokens);
void loadSetsFromXml(QXmlStreamReader &xml);
CardInfo *getCardFromMap(CardNameMap &cardMap, const QString &cardName, bool createIfNotFound);
void checkUnknownSets();
public:
static const char* TOKENS_SETNAME;
@ -265,6 +267,7 @@ public:
bool getLoadSuccess() const { return loadStatus == Ok; }
void cacheCardPixmaps(const QStringList &cardNames);
void loadImage(CardInfo *card);
bool hasDetectedFirstRun();
public slots:
void clearPixmapCache();
LoadStatus loadCardDatabase(const QString &path, bool tokens = false);