|
|
|
@ -66,6 +66,7 @@
@@ -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
@@ -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)
@@ -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
@@ -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")); |
|
|
|
|