Commit 19d1af34 authored by Frederik Schwarzer's avatar Frederik Schwarzer

QStandardPaths::DataLocation is deprecated.

parent 92282b13
......@@ -67,7 +67,7 @@ PlayGround::~PlayGround()
// Reset the play ground
void PlayGround::reset()
{
foreach(QGraphicsItem *item, scene()->items())
{
ToDraw *currentObject = qgraphicsitem_cast<ToDraw *>(item);
......@@ -317,7 +317,7 @@ bool PlayGround::isAspectRatioLocked() const
void PlayGround::registerPlayGrounds()
{
QSet<QString> list;
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("pics"), QStandardPaths::LocateDirectory);
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("pics"), QStandardPaths::LocateDirectory);
Q_FOREACH (const QString &dir, dirs)
{
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.theme"));
......@@ -336,7 +336,7 @@ void PlayGround::registerPlayGrounds()
if (layoutDocument.setContent(&layoutFile))
{
QString desktop = layoutDocument.documentElement().attribute(QStringLiteral( "desktop" ));
KConfig c( QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String( "pics/" ) + desktop ) );
KConfig c( QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String( "pics/" ) + desktop ) );
KConfigGroup cg = c.group("KTuberlingTheme");
QString gameboard = layoutDocument.documentElement().attribute(QStringLiteral( "gameboard" ));
QPixmap pixmap(200,100);
......@@ -350,7 +350,7 @@ void PlayGround::registerPlayGrounds()
void PlayGround::playGroundPixmap(const QString &playgroundName, QPixmap &pixmap)
{
m_SvgRenderer.load(QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String( "pics/" ) + playgroundName ));
m_SvgRenderer.load(QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String( "pics/" ) + playgroundName ));
QPainter painter(&pixmap);
m_SvgRenderer.render(&painter,QStringLiteral( "background" ));
}
......@@ -382,7 +382,7 @@ bool PlayGround::loadPlayGround(const QString &gameboardFile)
if (!bgColor.isValid())
bgColor = Qt::white;
if (!m_SvgRenderer.load(QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String( "pics/" ) + gameboardName )))
if (!m_SvgRenderer.load(QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String( "pics/" ) + gameboardName )))
return false;
objectsList = playGroundElement.elementsByTagName(QStringLiteral( "object" ));
......
......@@ -51,7 +51,7 @@ void SoundFactory::playSound(const QString &soundRef) const
if (!namesList[sound].compare(soundRef)) break;
if (sound == sounds) return;
soundFile = QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String( "sounds/" ) + filesList[sound]);
soundFile = QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String( "sounds/" ) + filesList[sound]);
if (soundFile.isEmpty()) return;
//printf("%s\n", (const char *) soundFile);
......@@ -63,7 +63,7 @@ void SoundFactory::playSound(const QString &soundRef) const
void SoundFactory::registerLanguages()
{
QSet<QString> list;
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("sounds"), QStandardPaths::LocateDirectory);
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("sounds"), QStandardPaths::LocateDirectory);
Q_FOREACH (const QString &dir, dirs)
{
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.soundtheme"));
......@@ -82,7 +82,7 @@ void SoundFactory::registerLanguages()
if (document.setContent(&file))
{
QString code = document.documentElement().attribute(QStringLiteral( "code" ));
bool enabled = !(QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String( "sounds/" ) + code + QLatin1Char( '/' ), QStandardPaths::LocateDirectory).isEmpty());
bool enabled = !(QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String( "sounds/" ) + code + QLatin1Char( '/' ), QStandardPaths::LocateDirectory).isEmpty());
topLevel->registerLanguage(code, soundTheme, enabled);
}
}
......
......@@ -142,7 +142,7 @@ void TopLevel::changeGameboard(const QString &newGameBoard)
QFileInfo fi(newGameBoard);
if (fi.isRelative())
{
fileToLoad = QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String( "pics/" ) + newGameBoard);
fileToLoad = QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String( "pics/" ) + newGameBoard);
}
else
{
......@@ -189,7 +189,7 @@ void TopLevel::changeLanguage(const QString &soundFile)
QFileInfo fi(soundFile);
if (fi.isRelative())
{
fileToLoad = QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String( "sounds/" ) + soundFile);
fileToLoad = QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String( "sounds/" ) + soundFile);
}
else
{
......
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