mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-22 23:26:14 -08:00
Fix oracle under windows
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#endif
|
||||
#include <QAbstractButton>
|
||||
#include <QCheckBox>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
@@ -403,15 +404,13 @@ bool SaveSetsPage::validatePage()
|
||||
QStandardPaths::standardLocations(QStandardPaths::DataLocation).first();
|
||||
#endif
|
||||
QSettings* settings = new QSettings(this);
|
||||
QString savePath = settings->value("paths/carddatabase").toString();
|
||||
if (savePath.isEmpty()) {
|
||||
QDir().mkpath(dataDir);
|
||||
}
|
||||
QString defaultPath = settings->value("paths/carddatabase").toString();
|
||||
QString windowName = tr("Save card database");
|
||||
QString fileType = tr("XML; card database (*.xml)");
|
||||
|
||||
do {
|
||||
QString fileName;
|
||||
if (savePath.isEmpty()) {
|
||||
if (defaultPath.isEmpty()) {
|
||||
if (defaultPathCheckBox->isChecked())
|
||||
fileName = dataDir + "/cards.xml";
|
||||
else
|
||||
@@ -420,13 +419,19 @@ bool SaveSetsPage::validatePage()
|
||||
}
|
||||
else {
|
||||
if (defaultPathCheckBox->isChecked())
|
||||
fileName = savePath;
|
||||
fileName = defaultPath;
|
||||
else
|
||||
fileName = QFileDialog::getSaveFileName(this, windowName, savePath, fileType);
|
||||
fileName = QFileDialog::getSaveFileName(this, windowName, defaultPath, fileType);
|
||||
}
|
||||
if (fileName.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QFileInfo fi(fileName);
|
||||
QDir fileDir(fi.path());
|
||||
if (!fileDir.exists() && !fileDir.mkpath(fileDir.absolutePath())) {
|
||||
return false;
|
||||
}
|
||||
if (wizard()->importer->saveToFile(fileName))
|
||||
{
|
||||
ok = true;
|
||||
|
||||
Reference in New Issue
Block a user