Store search history

PR #22208.
This commit is contained in:
Vladimir Golovnev 2025-01-30 08:59:10 +03:00 committed by GitHub
parent f8536162f2
commit b76054beba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 246 additions and 7 deletions

View file

@ -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);