diff --git a/src/app/application.cpp b/src/app/application.cpp index 6013cc95c..a248eb9b0 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -220,7 +220,7 @@ void Application::setFileLoggerEnabled(const bool value) QString Application::fileLoggerPath() const { - return m_storeFileLoggerPath.get(specialFolderLocation(SpecialFolder::Data) + LOG_FOLDER); + return m_storeFileLoggerPath.get(QDir(specialFolderLocation(SpecialFolder::Data)).absoluteFilePath(LOG_FOLDER)); } void Application::setFileLoggerPath(const QString &path) diff --git a/src/app/upgrade.cpp b/src/app/upgrade.cpp index 71db41215..3308d523f 100644 --- a/src/app/upgrade.cpp +++ b/src/app/upgrade.cpp @@ -74,10 +74,10 @@ namespace const QString configPath {specialFolderLocation(SpecialFolder::Config)}; migrate(QLatin1String("Preferences/WebUI/HTTPS/Certificate") , QLatin1String("Preferences/WebUI/HTTPS/CertificatePath") - , Utils::Fs::toNativePath(configPath + QLatin1String("WebUICertificate.crt"))); + , Utils::Fs::toNativePath(configPath + QLatin1String("/WebUICertificate.crt"))); migrate(QLatin1String("Preferences/WebUI/HTTPS/Key") , QLatin1String("Preferences/WebUI/HTTPS/KeyPath") - , Utils::Fs::toNativePath(configPath + QLatin1String("WebUIPrivateKey.pem"))); + , Utils::Fs::toNativePath(configPath + QLatin1String("/WebUIPrivateKey.pem"))); } void upgradeTorrentContentLayout() diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 62fa25445..20adfecb9 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -4313,7 +4313,7 @@ void Session::startUpTorrents() qDebug("Initializing torrents resume data storage..."); const QString dbPath = Utils::Fs::expandPathAbs( - specialFolderLocation(SpecialFolder::Data) + QLatin1String("torrents.db")); + specialFolderLocation(SpecialFolder::Data) + QLatin1String("/torrents.db")); const bool dbStorageExists = QFile::exists(dbPath); ResumeDataStorage *startupStorage = nullptr; @@ -4324,14 +4324,14 @@ void Session::startUpTorrents() if (!dbStorageExists) { const QString dataPath = Utils::Fs::expandPathAbs( - specialFolderLocation(SpecialFolder::Data) + QLatin1String("BT_backup")); + specialFolderLocation(SpecialFolder::Data) + QLatin1String("/BT_backup")); startupStorage = new BencodeResumeDataStorage(dataPath, this); } } else { const QString dataPath = Utils::Fs::expandPathAbs( - specialFolderLocation(SpecialFolder::Data) + QLatin1String("BT_backup")); + specialFolderLocation(SpecialFolder::Data) + QLatin1String("/BT_backup")); m_resumeDataStorage = new BencodeResumeDataStorage(dataPath, this); if (dbStorageExists) diff --git a/src/base/net/geoipmanager.cpp b/src/base/net/geoipmanager.cpp index f0bd89cdb..449b3b49f 100644 --- a/src/base/net/geoipmanager.cpp +++ b/src/base/net/geoipmanager.cpp @@ -89,7 +89,7 @@ void GeoIPManager::loadDatabase() m_geoIPDatabase = nullptr; const QString filepath = Utils::Fs::expandPathAbs( - QString::fromLatin1("%1%2/%3").arg(specialFolderLocation(SpecialFolder::Data), GEODB_FOLDER, GEODB_FILENAME)); + QString::fromLatin1("%1/%2/%3").arg(specialFolderLocation(SpecialFolder::Data), GEODB_FOLDER, GEODB_FILENAME)); QString error; m_geoIPDatabase = GeoIPDatabase::load(filepath, error); @@ -448,7 +448,7 @@ void GeoIPManager::downloadFinished(const DownloadResult &result) .arg(m_geoIPDatabase->type(), m_geoIPDatabase->buildEpoch().toString()), Log::INFO); const QString targetPath = Utils::Fs::expandPathAbs( - specialFolderLocation(SpecialFolder::Data) + GEODB_FOLDER); + QDir(specialFolderLocation(SpecialFolder::Data)).absoluteFilePath(GEODB_FOLDER)); if (!QDir(targetPath).exists()) QDir().mkpath(targetPath); diff --git a/src/base/profile_p.cpp b/src/base/profile_p.cpp index a7c3ec5ae..cd06122ef 100644 --- a/src/base/profile_p.cpp +++ b/src/base/profile_p.cpp @@ -88,10 +88,10 @@ QString Private::DefaultProfile::dataLocation() const #else // On Linux keep using the legacy directory ~/.local/share/data/ if it exists const QString legacyDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) - + QLatin1String("/data/") + profileName() + QLatin1Char('/'); + + QLatin1String("/data/") + profileName(); const QString dataDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) - + QLatin1Char('/') + profileName() + QLatin1Char('/'); + + QLatin1Char('/') + profileName(); if (!QDir(dataDir).exists() && QDir(legacyDir).exists()) { diff --git a/src/base/rss/rss_autodownloader.cpp b/src/base/rss/rss_autodownloader.cpp index 84b673801..49345b5ff 100644 --- a/src/base/rss/rss_autodownloader.cpp +++ b/src/base/rss/rss_autodownloader.cpp @@ -108,7 +108,7 @@ AutoDownloader::AutoDownloader() m_instance = this; m_fileStorage = new AsyncFileStorage( - Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Config) + ConfFolderName)); + Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Config) + QLatin1Char('/') + ConfFolderName)); if (!m_fileStorage) throw RuntimeError(tr("Directory for RSS AutoDownloader data is unavailable.")); diff --git a/src/base/rss/rss_session.cpp b/src/base/rss/rss_session.cpp index 09fb0f1b5..f5806e568 100644 --- a/src/base/rss/rss_session.cpp +++ b/src/base/rss/rss_session.cpp @@ -67,7 +67,7 @@ Session::Session() m_instance = this; m_confFileStorage = new AsyncFileStorage( - Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Config) + ConfFolderName)); + Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Config) + QLatin1Char('/') + ConfFolderName)); m_confFileStorage->moveToThread(m_workingThread); connect(m_workingThread, &QThread::finished, m_confFileStorage, &AsyncFileStorage::deleteLater); connect(m_confFileStorage, &AsyncFileStorage::failed, [](const QString &fileName, const QString &errorString) @@ -77,7 +77,7 @@ Session::Session() }); m_dataFileStorage = new AsyncFileStorage( - Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Data) + DataFolderName)); + Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Data) + QLatin1Char('/') + DataFolderName)); m_dataFileStorage->moveToThread(m_workingThread); connect(m_workingThread, &QThread::finished, m_dataFileStorage, &AsyncFileStorage::deleteLater); connect(m_dataFileStorage, &AsyncFileStorage::failed, [](const QString &fileName, const QString &errorString) diff --git a/src/base/search/searchpluginmanager.cpp b/src/base/search/searchpluginmanager.cpp index 214a329ab..bdc4bafcf 100644 --- a/src/base/search/searchpluginmanager.cpp +++ b/src/base/search/searchpluginmanager.cpp @@ -367,7 +367,7 @@ QString SearchPluginManager::engineLocation() static QString location; if (location.isEmpty()) { - location = Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Data) + "nova3"); + location = Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Data) + "/nova3"); const QDir locationDir(location); locationDir.mkpath(locationDir.absolutePath());