Commit a903c231 authored by Mark Morschhäuser's avatar Mark Morschhäuser
Browse files

Qt5: QDesktopServices::storageLocation deprecated

parent 648a6a38
......@@ -120,7 +120,11 @@ int main(int argc, char *argv[])
qsrand(QDateTime::currentDateTime().toTime_t());
bool startMainProgram = true;
#if QT_VERSION < 0x050000
const QString dataDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#else
const QString dataDir = QStandardPaths::standardLocations(QStandardPaths::DataLocation)).toString();
#endif
if (!db->getLoadSuccess())
if (db->loadCardDatabase(dataDir + "/cards.xml"))
settingsCache->setCardDatabasePath(dataDir + "/cards.xml");
......
......@@ -24,7 +24,11 @@ const QString WindowMain::defaultSetsUrl = QString("http://www.woogerworks.com/f
WindowMain::WindowMain(QWidget *parent)
: QMainWindow(parent)
{
#if QT_VERSION < 0x050000
importer = new OracleImporter(QDesktopServices::storageLocation(QDesktopServices::DataLocation), this);
#else
importer = new OracleImporter(QStandardPaths::standardLocations(QStandardPaths::DataLocation)).toString(), this);
#endif
nam = new QNetworkAccessManager(this);
checkBoxLayout = new QVBoxLayout;
......@@ -176,7 +180,11 @@ void WindowMain::updateTotalProgress(int cardsImported, int setIndex, const QStr
if (nextSetName.isEmpty()) {
QMessageBox::information(this, tr("Oracle importer"), tr("Import finished: %1 cards.").arg(importer->getCardList().size()));
bool ok = false;
#if QT_VERSION < 0x050000
const QString dataDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#else
const QString dataDir = QStandardPaths::standardLocations(QStandardPaths::DataLocation)).toString();
#endif
QDir dir(dataDir);
if (!dir.exists())
dir.mkpath(dataDir);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment