mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
parent
f8536162f2
commit
b76054beba
6 changed files with 246 additions and 7 deletions
|
@ -655,6 +655,21 @@ void Preferences::setSearchEnabled(const bool enabled)
|
|||
setValue(u"Preferences/Search/SearchEnabled"_s, enabled);
|
||||
}
|
||||
|
||||
int Preferences::searchHistoryLength() const
|
||||
{
|
||||
const int val = value(u"Search/HistoryLength"_s, 50);
|
||||
return std::clamp(val, 0, 99);
|
||||
}
|
||||
|
||||
void Preferences::setSearchHistoryLength(const int length)
|
||||
{
|
||||
const int clampedLength = std::clamp(length, 0, 99);
|
||||
if (clampedLength == searchHistoryLength())
|
||||
return;
|
||||
|
||||
setValue(u"Search/HistoryLength"_s, clampedLength);
|
||||
}
|
||||
|
||||
bool Preferences::storeOpenedSearchTabs() const
|
||||
{
|
||||
return value(u"Search/StoreOpenedSearchTabs"_s, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue