Port from QStandardPaths::DataLocation to QStandardPaths::AppDataLocation

They are the same on Linux (but DataLocation is deprecated). On Windows this enables the use of the roaming path.

NO_CHANGELOG
This commit is contained in:
David Faure 2020-10-31 14:29:35 +01:00
parent 0fc98e5141
commit e6fb3c7a87
2 changed files with 2 additions and 2 deletions

View File

@ -145,7 +145,7 @@ void DataEngineManager::unloadEngine(const QString &name)
void DataEngineManager::timerEvent(QTimerEvent *)
{
#ifndef NDEBUG
QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/plasma_dataenginemanager_log");
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/plasma_dataenginemanager_log");
QFile f(path);
if (!f.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) {
// qCDebug(LOG_PLASMA) << "failed to open" << path;

View File

@ -66,7 +66,7 @@ void StorageThread::initializeDb(StorageJob *caller)
{
if (!m_db.open()) {
m_db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), QStringLiteral("plasma-storage-%1").arg((quintptr)this));
const QString storageDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
const QString storageDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
QDir().mkpath(storageDir);
m_db.setDatabaseName(storageDir + QLatin1Char('/') + QStringLiteral("plasma-storage2.db"));
}