mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 05:08:05 -06:00
Fix strip torrent root folder
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user