mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Merge pull request #19291 from Chocobo1/limits
Expose 'bdecode limits' settings
This commit is contained in:
commit
4f6038c350
13 changed files with 152 additions and 24 deletions
|
@ -304,6 +304,45 @@ void Preferences::setIconsInMenusEnabled(const bool enable)
|
|||
}
|
||||
#endif // Q_OS_MACOS
|
||||
|
||||
qint64 Preferences::getTorrentFileSizeLimit() const
|
||||
{
|
||||
return value(u"BitTorrent/TorrentFileSizeLimit"_s, (100 * 1024 * 1024));
|
||||
}
|
||||
|
||||
void Preferences::setTorrentFileSizeLimit(const qint64 value)
|
||||
{
|
||||
if (value == getTorrentFileSizeLimit())
|
||||
return;
|
||||
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue