Fixed a bug related to running Oracle before Cockatrice, leading to no default path for cards.xml.

This commit is contained in:
pliu037 2014-07-31 06:31:32 -04:00
parent 31912ee7c6
commit 41aaec2c08

View file

@ -374,12 +374,15 @@ bool SaveSetsPage::validatePage()
bool ok = false; bool ok = false;
QSettings* settings = new QSettings(this); QSettings* settings = new QSettings(this);
QString savePath = settings->value("paths/carddatabase").toString(); QString savePath = settings->value("paths/carddatabase").toString();
//Not really sure if dataDir is necessary anymore, but leaving it in for safety
const QString dataDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation); const QString dataDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
/*QDir dir(dataDir); if (savePath.isEmpty()) {
if (!dir.exists()) QDir dir(dataDir);
dir.mkpath(dataDir); if (!dir.exists())
QString savePath = dataDir + "/cards.xml";*/ dir.mkpath(dataDir);
savePath = dataDir + "/cards.xml";
settings->setValue("paths/carddatabase", savePath);
}
qDebug(savePath.toLatin1());
do { do {
QString fileName; QString fileName;
if (savePath.isEmpty() || !defaultPathCheckBox->isChecked()) if (savePath.isEmpty() || !defaultPathCheckBox->isChecked())