mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Replace wrappers in base/utils/fs.h with Profile::SpecialFolders::location()
This commit is contained in:
parent
44b6cb28f6
commit
0bf7fa15c1
9 changed files with 20 additions and 43 deletions
|
@ -66,6 +66,7 @@
|
|||
#include <libtorrent/torrent_info.hpp>
|
||||
|
||||
#include "base/logger.h"
|
||||
#include "base/profile.h"
|
||||
#include "base/net/downloadhandler.h"
|
||||
#include "base/net/downloadmanager.h"
|
||||
#include "base/net/portforwarder.h"
|
||||
|
@ -132,7 +133,7 @@ namespace
|
|||
return tmp;
|
||||
}
|
||||
|
||||
QString normalizeSavePath(QString path, const QString &defaultPath = Utils::Fs::QDesktopServicesDownloadLocation())
|
||||
QString normalizeSavePath(QString path, const QString &defaultPath = specialFolderLocation(SpecialFolder::Downloads))
|
||||
{
|
||||
path = path.trimmed();
|
||||
if (path.isEmpty())
|
||||
|
@ -266,7 +267,7 @@ Session::Session(QObject *parent)
|
|||
, m_isProxyPeerConnectionsEnabled(BITTORRENT_SESSION_KEY("ProxyPeerConnections"), false)
|
||||
, m_storedCategories(BITTORRENT_SESSION_KEY("Categories"))
|
||||
, m_maxRatioAction(BITTORRENT_SESSION_KEY("MaxRatioAction"), Pause)
|
||||
, m_defaultSavePath(BITTORRENT_SESSION_KEY("DefaultSavePath"), Utils::Fs::QDesktopServicesDownloadLocation(), normalizePath)
|
||||
, m_defaultSavePath(BITTORRENT_SESSION_KEY("DefaultSavePath"), specialFolderLocation(SpecialFolder::Downloads), normalizePath)
|
||||
, m_tempPath(BITTORRENT_SESSION_KEY("TempPath"), defaultSavePath() + "temp/", normalizePath)
|
||||
, m_isSubcategoriesEnabled(BITTORRENT_SESSION_KEY("SubcategoriesEnabled"), false)
|
||||
, m_isTempPathEnabled(BITTORRENT_SESSION_KEY("TempPathEnabled"), false)
|
||||
|
@ -3003,7 +3004,7 @@ bool Session::hasPerTorrentRatioLimit() const
|
|||
|
||||
void Session::initResumeFolder()
|
||||
{
|
||||
m_resumeFolderPath = Utils::Fs::expandPathAbs(Utils::Fs::QDesktopServicesDataLocation() + RESUME_FOLDER);
|
||||
m_resumeFolderPath = Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Data) + RESUME_FOLDER);
|
||||
QDir resumeFolderDir(m_resumeFolderPath);
|
||||
if (resumeFolderDir.exists() || resumeFolderDir.mkpath(resumeFolderDir.absolutePath())) {
|
||||
m_resumeFolderLock.setFileName(resumeFolderDir.absoluteFilePath("session.lock"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue