Commit 1360e56d authored by Frederik Schwarzer's avatar Frederik Schwarzer

QStandardPaths::DataLocation is deprecated.

parent 124847fc
...@@ -84,7 +84,7 @@ void ChooseLevelSetDialog::loadData() ...@@ -84,7 +84,7 @@ void ChooseLevelSetDialog::loadData()
{ {
m_ui.m_lwLevelSets->clear(); m_ui.m_lwLevelSets->clear();
QStringList fileList; QStringList fileList;
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("levels"), QStandardPaths::LocateDirectory); const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("levels"), QStandardPaths::LocateDirectory);
Q_FOREACH (const QString& dir, dirs) { Q_FOREACH (const QString& dir, dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.dat")); const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.dat"));
Q_FOREACH (const QString& file, fileNames) { Q_FOREACH (const QString& file, fileNames) {
...@@ -139,7 +139,7 @@ void ChooseLevelSetDialog::saveSettings() ...@@ -139,7 +139,7 @@ void ChooseLevelSetDialog::saveSettings()
{ {
QListWidgetItem* item = m_ui.m_lwLevelSets->currentItem(); QListWidgetItem* item = m_ui.m_lwLevelSets->currentItem();
if (item) if (item)
{ {
QString levelSetName = item->data(KAtomic::LevelSetNameRole).toString(); QString levelSetName = item->data(KAtomic::LevelSetNameRole).toString();
emit levelSetChanged(levelSetName); emit levelSetChanged(levelSetName);
......
...@@ -28,7 +28,7 @@ KAtomicHighscores::KAtomicHighscores() ...@@ -28,7 +28,7 @@ KAtomicHighscores::KAtomicHighscores()
KUser user; KUser user;
m_playerName = user.property(KUser::FullName).toString().isEmpty() ? user.loginName() : user.property(KUser::FullName).toString(); m_playerName = user.property(KUser::FullName).toString().isEmpty() ? user.loginName() : user.property(KUser::FullName).toString();
m_hsFile = KSharedConfig::openConfig( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "highscores", KConfig::SimpleConfig); m_hsFile = KSharedConfig::openConfig( QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1Char('/') + "highscores", KConfig::SimpleConfig);
} }
bool KAtomicHighscores::addScore( int numMoves, const QString& levelSetName, int level ) bool KAtomicHighscores::addScore( int numMoves, const QString& levelSetName, int level )
......
...@@ -100,7 +100,7 @@ void LevelSet::reset() ...@@ -100,7 +100,7 @@ void LevelSet::reset()
bool LevelSet::load(const QString& levelSetName) bool LevelSet::load(const QString& levelSetName)
{ {
QString file = QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("levels/%1.dat").arg(levelSetName)); QString file = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("levels/%1.dat").arg(levelSetName));
if (file.isEmpty()) if (file.isEmpty())
{ {
qDebug() << "level set \"" << levelSetName << "\" data file not found. Check your installation"; qDebug() << "level set \"" << levelSetName << "\" data file not found. Check your installation";
...@@ -288,7 +288,7 @@ const Molecule* LevelSet::readLevelMolecule(int levelNum) const ...@@ -288,7 +288,7 @@ const Molecule* LevelSet::readLevelMolecule(int levelNum) const
bool LevelSet::isDefaultLevelsAvailable() bool LevelSet::isDefaultLevelsAvailable()
{ {
QString file = QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("levels/%1.dat").arg(DEFAULT_LEVELSET_NAME)); QString file = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("levels/%1.dat").arg(DEFAULT_LEVELSET_NAME));
if (file.isEmpty()) if (file.isEmpty())
{ {
//qDebug() << "default level set \"" << DEFAULT_LEVELSET_NAME << "\" data file not found. Check your installation"; //qDebug() << "default level set \"" << DEFAULT_LEVELSET_NAME << "\" data file not found. Check your installation";
......
...@@ -45,7 +45,7 @@ struct Theme : public KgTheme ...@@ -45,7 +45,7 @@ struct Theme : public KgTheme
{ {
Theme() : KgTheme("pics/default_theme.desktop") Theme() : KgTheme("pics/default_theme.desktop")
{ {
setGraphicsPath(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("pics/default_theme.svgz"))); setGraphicsPath(QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("pics/default_theme.svgz")));
} }
}; };
......
Markdown is supported
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