mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Expose 'bdecode limits' settings
This includes: * Bdecode depth limit * Bdecode token limit
This commit is contained in:
@@ -317,6 +317,32 @@ void Preferences::setTorrentFileSizeLimit(const qint64 value)
|
||||
setValue(u"BitTorrent/TorrentFileSizeLimit"_s, value);
|
||||
}
|
||||
|
||||
int Preferences::getBdecodeDepthLimit() const
|
||||
{
|
||||
return value(u"BitTorrent/BdecodeDepthLimit"_s, 100);
|
||||
}
|
||||
|
||||
void Preferences::setBdecodeDepthLimit(const int value)
|
||||
{
|
||||
if (value == getBdecodeDepthLimit())
|
||||
return;
|
||||
|
||||
setValue(u"BitTorrent/BdecodeDepthLimit"_s, value);
|
||||
}
|
||||
|
||||
int Preferences::getBdecodeTokenLimit() const
|
||||
{
|
||||
return value(u"BitTorrent/BdecodeTokenLimit"_s, 10'000'000);
|
||||
}
|
||||
|
||||
void Preferences::setBdecodeTokenLimit(const int value)
|
||||
{
|
||||
if (value == getBdecodeTokenLimit())
|
||||
return;
|
||||
|
||||
setValue(u"BitTorrent/BdecodeTokenLimit"_s, value);
|
||||
}
|
||||
|
||||
bool Preferences::isToolbarDisplayed() const
|
||||
{
|
||||
return value(u"Preferences/General/ToolbarDisplayed"_s, true);
|
||||
|
||||
Reference in New Issue
Block a user