Fix strip torrent root folder

This commit is contained in:
Vladimir Golovnev (Glassez)
2017-04-15 17:21:24 +03:00
parent 6d7d566cdf
commit 22178f9997
7 changed files with 25 additions and 23 deletions

View File

@@ -244,6 +244,7 @@ Session::Session(QObject *parent)
, m_additionalTrackers(BITTORRENT_SESSION_KEY("AdditionalTrackers"))
, m_globalMaxRatio(BITTORRENT_SESSION_KEY("GlobalMaxRatio"), -1, [](qreal r) { return r < 0 ? -1. : r;})
, m_isAddTorrentPaused(BITTORRENT_SESSION_KEY("AddTorrentPaused"), false)
, m_isCreateTorrentSubfolder(BITTORRENT_SESSION_KEY("CreateTorrentSubfolder"), true)
, m_isAppendExtensionEnabled(BITTORRENT_SESSION_KEY("AddExtensionToIncompleteFiles"), false)
, m_refreshInterval(BITTORRENT_SESSION_KEY("RefreshInterval"), 1500)
, m_isPreallocationEnabled(BITTORRENT_SESSION_KEY("Preallocation"), false)
@@ -3253,6 +3254,16 @@ void Session::getPendingAlerts(std::vector<libt::alert *> &out, ulong time)
#endif
}
bool Session::isCreateTorrentSubfolder() const
{
return m_isCreateTorrentSubfolder;
}
void Session::setCreateTorrentSubfolder(bool value)
{
m_isCreateTorrentSubfolder = value;
}
// Read alerts sent by the BitTorrent session
void Session::readAlerts()
{

View File

@@ -222,6 +222,8 @@ namespace BitTorrent
void setPeXEnabled(bool enabled);
bool isAddTorrentPaused() const;
void setAddTorrentPaused(bool value);
bool isCreateTorrentSubfolder() const;
void setCreateTorrentSubfolder(bool value);
bool isTrackerEnabled() const;
void setTrackerEnabled(bool enabled);
bool isAppendExtensionEnabled() const;
@@ -539,6 +541,7 @@ namespace BitTorrent
CachedSettingValue<QString> m_additionalTrackers;
CachedSettingValue<qreal> m_globalMaxRatio;
CachedSettingValue<bool> m_isAddTorrentPaused;
CachedSettingValue<bool> m_isCreateTorrentSubfolder;
CachedSettingValue<bool> m_isAppendExtensionEnabled;
CachedSettingValue<uint> m_refreshInterval;
CachedSettingValue<bool> m_isPreallocationEnabled;

View File

@@ -263,16 +263,6 @@ void Preferences::setLastLocationPath(const QString &path)
setValue("Preferences/Downloads/LastLocationPath", Utils::Fs::fromNativePath(path));
}
bool Preferences::getTorrentCreateSubfolder() const
{
return value("Preferences/Downloads/CreateSubfolder", true).toBool();
}
void Preferences::setTorrentCreateSubfolder(bool b)
{
setValue("Preferences/Downloads/CreateSubfolder", b);
}
QVariantHash Preferences::getScanDirs() const
{
return value("Preferences/Downloads/ScanDirsV2").toHash();

View File

@@ -138,8 +138,6 @@ public:
void setLastLocationPath(const QString &path);
QVariantHash getScanDirs() const;
void setScanDirs(const QVariantHash &dirs);
bool getTorrentCreateSubfolder() const;
void setTorrentCreateSubfolder(bool b);
QString getScanDirsLastPath() const;
void setScanDirsLastPath(const QString &path);
bool isMailNotificationEnabled() const;