mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 21:52:32 -06:00
committed by
GitHub
parent
d8a03cd8d8
commit
e045b4678d
@@ -266,11 +266,7 @@ namespace
|
||||
{
|
||||
return [lower, upper](const T value) -> T
|
||||
{
|
||||
if (value < lower)
|
||||
return lower;
|
||||
if (value > upper)
|
||||
return upper;
|
||||
return value;
|
||||
return std::clamp(value, lower, upper);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "preferences.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
@@ -2122,7 +2123,7 @@ int Preferences::addNewTorrentDialogSavePathHistoryLength() const
|
||||
|
||||
void Preferences::setAddNewTorrentDialogSavePathHistoryLength(const int value)
|
||||
{
|
||||
const int clampedValue = qBound(0, value, 99);
|
||||
const int clampedValue = std::clamp(value, 0, 99);
|
||||
const int oldValue = addNewTorrentDialogSavePathHistoryLength();
|
||||
if (clampedValue == oldValue)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user