Commit 750d4cea authored by Frederik Schwarzer's avatar Frederik Schwarzer

QStandardPaths::DataLocation is deprecated.

parent 6f6fd483
......@@ -95,7 +95,7 @@ bool KgTheme::readFromDesktopFile(const QString& path_)
QString path(path_);
if (QFileInfo(path).isRelative())
{
path = QStandardPaths::locate(QStandardPaths::DataLocation, path);
path = QStandardPaths::locate(QStandardPaths::AppDataLocation, path);
if (path.isEmpty())
{
qCDebug(GAMES_LIB) << "Could not find theme description" << path;
......
......@@ -60,7 +60,7 @@ KgThemeProvider::KgThemeProvider(const QByteArray& configKey, QObject* parent)
, d(new Private(this, configKey))
{
QLoggingCategory::setFilterRules(QStringLiteral("games.lib.debug = true"));
qRegisterMetaType<const KgTheme*>();
qRegisterMetaType<KgThemeProvider*>();
connect(this, SIGNAL(currentThemeChanged(const KgTheme*)), this, SLOT(updateThemeName()));
......@@ -184,7 +184,7 @@ void KgThemeProvider::discoverThemes(const QByteArray& resource, const QString&
static QString relativeToApplications(const QString& file)
{
const QString canonical = QFileInfo(file).canonicalFilePath();
Q_FOREACH(const QString& base, QStandardPaths::standardLocations(QStandardPaths::DataLocation)) {
Q_FOREACH(const QString& base, QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)) {
if (canonical.startsWith(base))
return canonical.mid(base.length()+1);
}
......@@ -197,14 +197,14 @@ void KgThemeProvider::rediscoverThemes()
{
return; //discoverThemes() was never called
}
KgTheme* defaultTheme = NULL;
d->m_inRediscover = true;
const QString defaultFileName = d->m_dtDefaultThemeName + QLatin1String(".desktop");
QStringList themePaths;
QStringList dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, d->m_dtDirectory, QStandardPaths::LocateDirectory);
QStringList dirs = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, d->m_dtDirectory, QStandardPaths::LocateDirectory);
Q_FOREACH (const QString &dir, dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.desktop"));
Q_FOREACH (const QString &file, fileNames) {
......@@ -213,7 +213,7 @@ void KgThemeProvider::rediscoverThemes()
}
}
}
//create themes from result, order default theme at the front (that's not
//needed by KgThemeProvider, but nice for the theme selector)
QList<KgTheme*> themes;
......@@ -227,7 +227,7 @@ void KgThemeProvider::rediscoverThemes()
d->m_discoveredThemes << fi.fileName();
//the identifier is constructed such that it is compatible with
//KGameTheme (e.g. "themes/default.desktop")
const QByteArray id = relativeToApplications(themePath).toUtf8();
//create theme
KgTheme* theme;
......@@ -268,7 +268,7 @@ void KgThemeProvider::rediscoverThemes()
{
addTheme(theme);
}
if(defaultTheme != NULL)
{
setDefaultTheme(defaultTheme);
......@@ -277,7 +277,7 @@ void KgThemeProvider::rediscoverThemes()
{
setDefaultTheme(themes.value(0));
}
d->m_inRediscover = false;
}
......
......@@ -72,7 +72,7 @@ bool KGameTheme::load(const QString &fileName) {
qCDebug(GAMES_LIB) << "Refusing to load theme with no name";
return false;
}
QString filePath = QStandardPaths::locate(QStandardPaths::DataLocation, fileName);
QString filePath = QStandardPaths::locate(QStandardPaths::AppDataLocation, fileName);
qCDebug(GAMES_LIB) << "Attempting to load .desktop at" << filePath;
if (filePath.isEmpty()) {
return false;
......@@ -106,7 +106,7 @@ bool KGameTheme::load(const QString &fileName) {
}
QString graphName = group.readEntry("FileName");
//d->graphics = QStandardPaths::locate(QStandardPaths::DataLocation, graphName);
//d->graphics = QStandardPaths::locate(QStandardPaths::AppDataLocation, graphName);
d->graphics = d->prefix + graphName;
if (d->graphics.isEmpty()) return false;
......@@ -118,7 +118,7 @@ bool KGameTheme::load(const QString &fileName) {
}
QString previewName = group.readEntry("Preview");
//QString graphicsPath = QStandardPaths::locate(QStandardPaths::DataLocation, previewName);
//QString graphicsPath = QStandardPaths::locate(QStandardPaths::AppDataLocation, previewName);
QString graphicsPath = d->prefix + previewName;
d->preview = QPixmap(graphicsPath);
......
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