diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f222f18e..a90857b20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -438,6 +438,7 @@ set(SOURCES src/core/enginemetadata.cpp src/core/songmimedata.cpp src/core/platforminterface.cpp + src/core/standardpaths.cpp src/utilities/strutils.cpp src/utilities/envutils.cpp diff --git a/src/collection/collectionmodel.cpp b/src/collection/collectionmodel.cpp index 7abaf44c0..ecabd8f1b 100644 --- a/src/collection/collectionmodel.cpp +++ b/src/collection/collectionmodel.cpp @@ -50,14 +50,14 @@ #include #include #include -#include #include #include "includes/scoped_ptr.h" #include "includes/shared_ptr.h" +#include "core/logging.h" +#include "core/standardpaths.h" #include "core/database.h" #include "core/iconloader.h" -#include "core/logging.h" #include "core/settings.h" #include "core/songmimedata.h" #include "collectionfilteroptions.h" @@ -114,7 +114,7 @@ CollectionModel::CollectionModel(const SharedPtr backend, con pixmap_no_cover_ = nocover.pixmap(nocover_sizes.last()).scaled(kPrettyCoverSize, kPrettyCoverSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); } - icon_disk_cache_->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + u'/' + QLatin1String(kPixmapDiskCacheDir) + u'-' + Song::TextForSource(backend_->source())); + icon_disk_cache_->setCacheDirectory(StandardPaths::WritableLocation(StandardPaths::CacheLocation) + u'/' + QLatin1String(kPixmapDiskCacheDir) + u'-' + Song::TextForSource(backend_->source())); QObject::connect(&*backend_, &CollectionBackend::SongsAdded, this, &CollectionModel::AddReAddOrUpdate); QObject::connect(&*backend_, &CollectionBackend::SongsChanged, this, &CollectionModel::AddReAddOrUpdate); diff --git a/src/core/database.cpp b/src/core/database.cpp index b38f59f35..ed1ff69eb 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -39,10 +39,10 @@ #include #include #include -#include #include -#include "core/logging.h" +#include "logging.h" +#include "standardpaths.h" #include "taskmanager.h" #include "database.h" #include "sqlquery.h" @@ -78,7 +78,7 @@ Database::Database(SharedPtr task_manager, QObject *parent, const Q connection_id_ = sNextConnectionId++; } - directory_ = QDir::toNativeSeparators(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)); + directory_ = QDir::toNativeSeparators(StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation)).replace(u"Strawberry"_s, u"strawberry"_s); QMutexLocker l(&mutex_); Connect(); diff --git a/src/core/iconloader.cpp b/src/core/iconloader.cpp index 8096fef3b..8d9f58b7e 100644 --- a/src/core/iconloader.cpp +++ b/src/core/iconloader.cpp @@ -27,10 +27,10 @@ #include #include #include -#include #include #include "logging.h" +#include "standardpaths.h" #include "settings.h" #include "includes/iconmapper.h" #include "iconloader.h" @@ -51,7 +51,7 @@ void IconLoader::Init() { #endif QDir dir; - if (dir.exists(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/icons"_s)) { + if (dir.exists(StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation) + u"/icons"_s)) { custom_icons_ = true; } @@ -125,7 +125,7 @@ QIcon IconLoader::Load(const QString &name, const bool system_icon, const int fi } if (custom_icons_) { - QString custom_icon_path = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/icons/%1x%2/%3.png"_s; + QString custom_icon_path = StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation) + u"/icons/%1x%2/%3.png"_s; for (int s : std::as_const(sizes)) { QString filename(custom_icon_path.arg(s).arg(s).arg(name)); if (QFile::exists(filename)) ret.addFile(filename, QSize(s, s)); diff --git a/src/core/settings.cpp b/src/core/settings.cpp index c08bfbb2e..78be0b20c 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -1,6 +1,6 @@ /* * Strawberry Music Player - * Copyright 2024, Jonas Kvinge + * Copyright 2024-2025, Jonas Kvinge * * Strawberry is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,13 +18,26 @@ */ #include -#include #include +#include #include "settings.h" +using namespace Qt::Literals::StringLiterals; + Settings::Settings(QObject *parent) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) + : QSettings(QCoreApplication::organizationName().toLower(), QCoreApplication::applicationName().toLower(), parent) {} +#else : QSettings(parent) {} +#endif + +Settings::Settings(const QSettings::Scope scope, QObject *parent) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) + : QSettings(scope, QCoreApplication::organizationName().toLower(), QCoreApplication::applicationName().toLower(), parent) {} +#else + : QSettings(scope, parent) {} +#endif Settings::Settings(const QString &filename, const Format format, QObject *parent) : QSettings(filename, format, parent) {} diff --git a/src/core/settings.h b/src/core/settings.h index 716d8c79f..db3a40715 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -1,6 +1,6 @@ /* * Strawberry Music Player - * Copyright 2024, Jonas Kvinge + * Copyright 2024-2025, Jonas Kvinge * * Strawberry is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,14 +21,14 @@ #define SETTINGS_H #include -#include -#include +#include class Settings : public QSettings { Q_OBJECT public: explicit Settings(QObject *parent = nullptr); + explicit Settings(const QSettings::Scope scope, QObject *parent = nullptr); explicit Settings(const QString &filename, const Format format, QObject *parent = nullptr); }; diff --git a/src/core/song.cpp b/src/core/song.cpp index 53f580ec3..16f717b75 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -45,11 +45,11 @@ #include #include #include -#include #include #include +#include "core/standardpaths.h" #include "core/iconloader.h" #include "core/enginemetadata.h" #include "utilities/strutils.h" @@ -1335,24 +1335,24 @@ QString Song::ImageCacheDir(const Source source) { switch (source) { case Source::Collection: - return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/collectionalbumcovers"_s; + return StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation) + u"/collectionalbumcovers"_s; case Source::Subsonic: - return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/subsonicalbumcovers"_s; + return StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation) + u"/subsonicalbumcovers"_s; case Source::Tidal: - return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/tidalalbumcovers"_s; + return StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation) + u"/tidalalbumcovers"_s; case Source::Spotify: - return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/spotifyalbumcovers"_s; + return StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation) + u"/spotifyalbumcovers"_s; case Source::Qobuz: - return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/qobuzalbumcovers"_s; + return StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation) + u"/qobuzalbumcovers"_s; case Source::Device: - return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/devicealbumcovers"_s; + return StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation) + u"/devicealbumcovers"_s; case Source::LocalFile: case Source::CDDA: case Source::Stream: case Source::SomaFM: case Source::RadioParadise: case Source::Unknown: - return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/albumcovers"_s; + return StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation) + u"/albumcovers"_s; } return QString(); diff --git a/src/core/standardpaths.cpp b/src/core/standardpaths.cpp new file mode 100644 index 000000000..28c62d81e --- /dev/null +++ b/src/core/standardpaths.cpp @@ -0,0 +1,82 @@ +/* + * Strawberry Music Player + * Copyright 2025, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ + +#include +#include +#include +#include + +#include "standardpaths.h" + +using namespace Qt::StringLiterals; + +void StandardPaths::AppendOrganizationAndApplication(QString &path) { + + const QString organization_name = QCoreApplication::organizationName().toLower(); + if (!organization_name.isEmpty()) { + path += u'/' + organization_name; + } + const QString application_name = QCoreApplication::applicationName().toLower(); + if (!application_name.isEmpty()) { + path += u'/' + application_name; + } + +} + +QString StandardPaths::WritableLocation(const StandardLocation type) { + +#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) + switch (type) { + case CacheLocation: + case GenericCacheLocation:{ + QString cache_location = qEnvironmentVariable("XDG_CACHE_HOME"); + if (!cache_location.startsWith(u'/')) { + cache_location.clear(); + } + if (cache_location.isEmpty()) { + cache_location = QDir::homePath() + "/.cache"_L1; + } + if (type == QStandardPaths::CacheLocation) { + AppendOrganizationAndApplication(cache_location); + } + return cache_location; + } + case AppDataLocation: + case AppLocalDataLocation: + case GenericDataLocation:{ + QString data_location = qEnvironmentVariable("XDG_DATA_HOME"); + if (!data_location.startsWith(u'/')) { + data_location.clear(); + } + if (data_location.isEmpty()) { + data_location = QDir::homePath() + "/.local/share"_L1; + } + if (type == AppDataLocation || type == AppLocalDataLocation) { + AppendOrganizationAndApplication(data_location); + } + return data_location; + } + default: + break; + } +#endif + + return QStandardPaths::writableLocation(type); + +} diff --git a/src/core/standardpaths.h b/src/core/standardpaths.h new file mode 100644 index 000000000..0982bc117 --- /dev/null +++ b/src/core/standardpaths.h @@ -0,0 +1,36 @@ +/* + * Strawberry Music Player + * Copyright 2025, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ + +#ifndef STANDARDPATHS_H +#define STANDARDPATHS_H + +#include + +class StandardPaths : public QStandardPaths { + Q_GADGET + + public: + static QString WritableLocation(const StandardLocation type); + static QString writableLocation(const StandardLocation type) = delete; + + private: + static void AppendOrganizationAndApplication(QString &path); +}; + +#endif // STANDARDPATHS_H diff --git a/src/core/threadsafenetworkdiskcache.cpp b/src/core/threadsafenetworkdiskcache.cpp index 7bdbc2021..17dac5ba7 100644 --- a/src/core/threadsafenetworkdiskcache.cpp +++ b/src/core/threadsafenetworkdiskcache.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -32,6 +31,7 @@ #include #include +#include "standardpaths.h" #include "threadsafenetworkdiskcache.h" using namespace Qt::Literals::StringLiterals; @@ -48,9 +48,9 @@ ThreadSafeNetworkDiskCache::ThreadSafeNetworkDiskCache(QObject *parent) : QAbstr if (!sCache) { sCache = new QNetworkDiskCache; #ifdef Q_OS_WIN32 - sCache->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::TempLocation) + u"/strawberry/networkcache"_s); + sCache->setCacheDirectory(StandardPaths::WritableLocation(StandardPaths::TempLocation) + u"/strawberry/networkcache"_s); #else - sCache->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + u"/networkcache"_s); + sCache->setCacheDirectory(StandardPaths::WritableLocation(StandardPaths::CacheLocation) + u"/networkcache"_s); #endif } diff --git a/src/covermanager/currentalbumcoverloader.cpp b/src/covermanager/currentalbumcoverloader.cpp index 8829064bc..6599a5462 100644 --- a/src/covermanager/currentalbumcoverloader.cpp +++ b/src/covermanager/currentalbumcoverloader.cpp @@ -27,9 +27,9 @@ #include #include #include -#include #include "core/logging.h" +#include "core/standardpaths.h" #include "core/song.h" #include "core/temporaryfile.h" #include "albumcoverloader.h" @@ -42,7 +42,7 @@ using namespace Qt::Literals::StringLiterals; CurrentAlbumCoverLoader::CurrentAlbumCoverLoader(const SharedPtr albumcover_loader, QObject *parent) : QObject(parent), albumcover_loader_(albumcover_loader), - temp_file_pattern_(QStandardPaths::writableLocation(QStandardPaths::TempLocation) + u"/strawberry-cover-XXXXXX.jpg"_s), + temp_file_pattern_(StandardPaths::WritableLocation(StandardPaths::TempLocation) + u"/strawberry-cover-XXXXXX.jpg"_s), id_(0) { setObjectName(QLatin1String(metaObject()->className())); diff --git a/src/device/gpoddevice.cpp b/src/device/gpoddevice.cpp index 2dfb2676f..0b99387c7 100644 --- a/src/device/gpoddevice.cpp +++ b/src/device/gpoddevice.cpp @@ -36,10 +36,10 @@ #include #include #include -#include #include "includes/shared_ptr.h" #include "core/logging.h" +#include "core/standardpaths.h" #include "core/temporaryfile.h" #include "core/taskmanager.h" #include "core/database.h" @@ -211,9 +211,9 @@ bool GPodDevice::CopyToStorage(const CopyJob &job, QString &error_text) { bool result = false; if (!job.cover_image_.isNull()) { #ifdef Q_OS_LINUX - QString temp_path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + u"/organize"_s; + QString temp_path = StandardPaths::WritableLocation(StandardPaths::CacheLocation) + u"/organize"_s; #else - QString temp_path = QStandardPaths::writableLocation(QStandardPaths::TempLocation); + QString temp_path = StandardPaths::WritableLocation(StandardPaths::TempLocation); #endif if (!QDir(temp_path).exists()) QDir().mkpath(temp_path); SharedPtr cover_file = make_shared(temp_path + u"/track-albumcover-XXXXXX.jpg"_s); diff --git a/src/engine/gststartup.cpp b/src/engine/gststartup.cpp index b34108fe9..dd9afbf19 100644 --- a/src/engine/gststartup.cpp +++ b/src/engine/gststartup.cpp @@ -26,12 +26,12 @@ #include #include -#include #include #include #include #include "core/logging.h" +#include "core/standardpaths.h" #include "utilities/envutils.h" #ifdef HAVE_MOODBAR @@ -145,7 +145,7 @@ void SetEnvironment() { #endif // USE_BUNDLE #if defined(Q_OS_WIN32) || defined(Q_OS_MACOS) - QString gst_registry_filename = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QStringLiteral("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion()); + QString gst_registry_filename = StandardPaths::WritableLocation(StandardPaths::AppLocalDataLocation) + QStringLiteral("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion()); qLog(Debug) << "Setting GStreamer registry file to" << gst_registry_filename; Utilities::SetEnv("GST_REGISTRY", gst_registry_filename); #endif diff --git a/src/main.cpp b/src/main.cpp index b3c14d80c..a336c37c5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -70,6 +69,7 @@ #include "includes/shared_ptr.h" #include "core/logging.h" +#include "core/standardpaths.h" #include "core/settings.h" #include "utilities/envutils.h" @@ -131,13 +131,8 @@ int main(int argc, char *argv[]) { mac::MacMain(); #endif -#if defined(Q_OS_WIN32) || defined(Q_OS_MACOS) QCoreApplication::setApplicationName(u"Strawberry"_s); QCoreApplication::setOrganizationName(u"Strawberry"_s); -#else - QCoreApplication::setApplicationName(u"strawberry"_s); - QCoreApplication::setOrganizationName(u"strawberry"_s); -#endif QCoreApplication::setApplicationVersion(QStringLiteral(STRAWBERRY_VERSION_DISPLAY)); QCoreApplication::setOrganizationDomain(u"strawberrymusicplayer.org"_s); @@ -174,7 +169,7 @@ int main(int argc, char *argv[]) { #ifdef Q_OS_MACOS // Must happen after QCoreApplication::setOrganizationName(). - Utilities::SetEnv("XDG_CONFIG_HOME", QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)); + Utilities::SetEnv("XDG_CONFIG_HOME", StandardPaths::WritableLocation(StandardPaths::AppConfigLocation)); #endif // Output the version, so when people attach log output to bug reports they don't have to tell us which version they're using. diff --git a/src/moodbar/moodbarloader.cpp b/src/moodbar/moodbarloader.cpp index bcc16b4bb..391e62629 100644 --- a/src/moodbar/moodbarloader.cpp +++ b/src/moodbar/moodbarloader.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -43,6 +42,7 @@ #include "includes/scoped_ptr.h" #include "includes/shared_ptr.h" #include "core/logging.h" +#include "core/standardpaths.h" #include "core/settings.h" #include "moodbarpipeline.h" @@ -64,7 +64,7 @@ MoodbarLoader::MoodbarLoader(QObject *parent) kMaxActiveRequests(qMax(1, QThread::idealThreadCount() / 2)), save_(false) { - cache_->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + u"/moodbar"_s); + cache_->setCacheDirectory(StandardPaths::WritableLocation(StandardPaths::CacheLocation) + u"/moodbar"_s); cache_->setMaximumCacheSize(60LL * 1024LL * 1024LL); // 60MB - enough for 20,000 moodbars ReloadSettings(); diff --git a/src/scrobbler/scrobblercache.cpp b/src/scrobbler/scrobblercache.cpp index 48fba1629..fcdefb75d 100644 --- a/src/scrobbler/scrobblercache.cpp +++ b/src/scrobbler/scrobblercache.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -38,6 +37,7 @@ #include "core/song.h" #include "core/logging.h" +#include "core/standardpaths.h" #include "scrobblercache.h" #include "scrobblercacheitem.h" @@ -49,7 +49,7 @@ using std::make_shared; ScrobblerCache::ScrobblerCache(const QString &filename, QObject *parent) : QObject(parent), timer_flush_(new QTimer(this)), - filename_(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/') + filename), + filename_(StandardPaths::WritableLocation(StandardPaths::CacheLocation) + QLatin1Char('/') + filename), loaded_(false) { ReadCache(); diff --git a/src/settings/behavioursettingspage.cpp b/src/settings/behavioursettingspage.cpp index 0a05ff67c..36b19ed37 100644 --- a/src/settings/behavioursettingspage.cpp +++ b/src/settings/behavioursettingspage.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include "constants/behavioursettings.h" #include "core/iconloader.h" diff --git a/src/settings/collectionsettingspage.cpp b/src/settings/collectionsettingspage.cpp index 6d1b4f0fd..84984a181 100644 --- a/src/settings/collectionsettingspage.cpp +++ b/src/settings/collectionsettingspage.cpp @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -47,6 +46,7 @@ #include "constants/filesystemconstants.h" #include "core/iconloader.h" +#include "core/standardpaths.h" #include "core/settings.h" #include "utilities/strutils.h" #include "collection/collectionlibrary.h" @@ -246,7 +246,7 @@ void CollectionSettingsPage::AddDirectory() { Settings s; s.beginGroup(kSettingsGroup); - QString path = s.value(kLastPath, QStandardPaths::writableLocation(QStandardPaths::MusicLocation)).toString(); + QString path = s.value(kLastPath, StandardPaths::WritableLocation(StandardPaths::MusicLocation)).toString(); path = QDir::cleanPath(QFileDialog::getExistingDirectory(this, tr("Add directory..."), path)); if (!path.isEmpty()) { diff --git a/src/transcoder/transcoder.cpp b/src/transcoder/transcoder.cpp index d3793de00..883f42a5a 100644 --- a/src/transcoder/transcoder.cpp +++ b/src/transcoder/transcoder.cpp @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -44,6 +43,7 @@ #include "includes/shared_ptr.h" #include "core/logging.h" +#include "core/standardpaths.h" #include "core/signalchecker.h" #include "core/settings.h" #include "transcoder.h" @@ -283,7 +283,7 @@ QString Transcoder::GetFile(const QString &input, const TranscoderPreset &preset if (!fileinfo_output.isFile() || fileinfo_output.filePath().isEmpty() || fileinfo_output.path().isEmpty() || fileinfo_output.fileName().isEmpty() || fileinfo_output.suffix().isEmpty()) { QFileInfo fileinfo_input(input); - QString temp_dir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/transcoder"_L1; + QString temp_dir = StandardPaths::WritableLocation(StandardPaths::CacheLocation) + "/transcoder"_L1; if (!QDir(temp_dir).exists()) QDir().mkpath(temp_dir); QString filename = fileinfo_input.completeBaseName() + QLatin1Char('.') + preset.extension_; fileinfo_output.setFile(temp_dir + QLatin1Char('/') + filename); diff --git a/src/utilities/coverutils.cpp b/src/utilities/coverutils.cpp index 1ffad8ba1..87032a900 100644 --- a/src/utilities/coverutils.cpp +++ b/src/utilities/coverutils.cpp @@ -23,13 +23,13 @@ #include #include #include -#include #include #include "constants/filenameconstants.h" +#include "core/logging.h" +#include "core/standardpaths.h" #include "transliterate.h" #include "coverutils.h" -#include "core/logging.h" using namespace Qt::Literals::StringLiterals; @@ -85,7 +85,7 @@ QString CoverUtils::CoverFilePath(const CoverOptions &options, const Song::Sourc QDir dir; if (!QFileInfo::exists(path) && !dir.mkpath(path)) { qLog(Error) << "Unable to create directory" << path; - path = QStandardPaths::writableLocation(QStandardPaths::TempLocation); + path = StandardPaths::WritableLocation(StandardPaths::TempLocation); } QString filename;