mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-04 14:42:29 -06:00
Group several torrent options into one dialog
Speed limits, share limits and the new options to disable DHT, PeX, LSD per torrent
This commit is contained in:
@@ -1028,6 +1028,21 @@ bool TorrentHandleImpl::superSeeding() const
|
||||
return static_cast<bool>(m_nativeStatus.flags & lt::torrent_flags::super_seeding);
|
||||
}
|
||||
|
||||
bool TorrentHandleImpl::isDHTDisabled() const
|
||||
{
|
||||
return static_cast<bool>(m_nativeStatus.flags & lt::torrent_flags::disable_dht);
|
||||
}
|
||||
|
||||
bool TorrentHandleImpl::isPEXDisabled() const
|
||||
{
|
||||
return static_cast<bool>(m_nativeStatus.flags & lt::torrent_flags::disable_pex);
|
||||
}
|
||||
|
||||
bool TorrentHandleImpl::isLSDDisabled() const
|
||||
{
|
||||
return static_cast<bool>(m_nativeStatus.flags & lt::torrent_flags::disable_lsd);
|
||||
}
|
||||
|
||||
QVector<PeerInfo> TorrentHandleImpl::peers() const
|
||||
{
|
||||
std::vector<lt::peer_info> nativePeers;
|
||||
@@ -1966,10 +1981,50 @@ void TorrentHandleImpl::setDownloadLimit(const int limit)
|
||||
|
||||
void TorrentHandleImpl::setSuperSeeding(const bool enable)
|
||||
{
|
||||
if (enable == superSeeding())
|
||||
return;
|
||||
|
||||
if (enable)
|
||||
m_nativeHandle.set_flags(lt::torrent_flags::super_seeding);
|
||||
else
|
||||
m_nativeHandle.unset_flags(lt::torrent_flags::super_seeding);
|
||||
saveResumeData();
|
||||
}
|
||||
|
||||
void TorrentHandleImpl::setDHTDisabled(const bool disable)
|
||||
{
|
||||
if (disable == isDHTDisabled())
|
||||
return;
|
||||
|
||||
if (disable)
|
||||
m_nativeHandle.set_flags(lt::torrent_flags::disable_dht);
|
||||
else
|
||||
m_nativeHandle.unset_flags(lt::torrent_flags::disable_dht);
|
||||
saveResumeData();
|
||||
}
|
||||
|
||||
void TorrentHandleImpl::setPEXDisabled(const bool disable)
|
||||
{
|
||||
if (disable == isPEXDisabled())
|
||||
return;
|
||||
|
||||
if (disable)
|
||||
m_nativeHandle.set_flags(lt::torrent_flags::disable_pex);
|
||||
else
|
||||
m_nativeHandle.unset_flags(lt::torrent_flags::disable_pex);
|
||||
saveResumeData();
|
||||
}
|
||||
|
||||
void TorrentHandleImpl::setLSDDisabled(const bool disable)
|
||||
{
|
||||
if (disable == isLSDDisabled())
|
||||
return;
|
||||
|
||||
if (disable)
|
||||
m_nativeHandle.set_flags(lt::torrent_flags::disable_lsd);
|
||||
else
|
||||
m_nativeHandle.unset_flags(lt::torrent_flags::disable_lsd);
|
||||
saveResumeData();
|
||||
}
|
||||
|
||||
void TorrentHandleImpl::flushCache() const
|
||||
|
||||
Reference in New Issue
Block a user