// no set is enabled. Probably this is the first time running trice
if(!sets.getEnabledSetsNum())
if(sets.getEnabledSetsNum())
{
// if some sets are first found on thus run, ask the user
intnumUnknownSets=sets.getUnknownSetsNum();
if(numUnknownSets>0)
emitcardDatabaseNewSetsFound(numUnknownSets);
}else{
// No set enabled. Probably this is the first time running trice
sets.guessSortKeys();
sets.sortByKey();
sets.enableAll();
notifyEnabledSetsChanged();
detectedFirstRun=true;
return;
emitcardDatabaseAllNewSetsEnabled();
}
}
detectedFirstRun=false;
intnumUnknownSets=sets.getUnknownSetsNum();
// no unkown sets.
if(!numUnknownSets)
return;
QMessageBoxmsgbox(QMessageBox::Question,tr("New sets found"),tr("%1 new set(s) have been found in the card database. Do you want to enable them?").arg(numUnknownSets),QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel);
voidCardDatabase::enableAllUnknownSets()
{
SetListsets=getSetList();
sets.enableAllUnknown();
}
switch(msgbox.exec())
{
caseQMessageBox::No:
voidCardDatabase::markAllSetsAsKnown()
{
SetListsets=getSetList();
sets.markAllAsKnown();
break;
caseQMessageBox::Yes:
sets.enableAllUnknown();
break;
default:
break;
}
}
return;
voidCardDatabase::notifyEnabledSetsChanged()
{
// refresh the list of cached set names
foreach(CardInfo*card,cards)
card->refreshCachedSetNames();
// inform the carddatabasemodels that they need to re-check their list of cards