mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-11 21:04:07 -07:00
Fixed a bug related to running Oracle before Cockatrice, leading to no default path for cards.xml.
This commit is contained in:
parent
31912ee7c6
commit
41aaec2c08
1 changed files with 8 additions and 5 deletions
|
|
@ -374,12 +374,15 @@ bool SaveSetsPage::validatePage()
|
|||
bool ok = false;
|
||||
QSettings* settings = new QSettings(this);
|
||||
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);
|
||||
/*QDir dir(dataDir);
|
||||
if (!dir.exists())
|
||||
dir.mkpath(dataDir);
|
||||
QString savePath = dataDir + "/cards.xml";*/
|
||||
if (savePath.isEmpty()) {
|
||||
QDir dir(dataDir);
|
||||
if (!dir.exists())
|
||||
dir.mkpath(dataDir);
|
||||
savePath = dataDir + "/cards.xml";
|
||||
settings->setValue("paths/carddatabase", savePath);
|
||||
}
|
||||
qDebug(savePath.toLatin1());
|
||||
do {
|
||||
QString fileName;
|
||||
if (savePath.isEmpty() || !defaultPathCheckBox->isChecked())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue