mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-24 05:25:37 +00:00
[Web UI] Fix max_ratio precision. Closes #4707
This commit is contained in:
parent
193913129f
commit
87dc9a4a18
@ -969,7 +969,7 @@ void Preferences::setTrackersList(const QString &val)
|
|||||||
|
|
||||||
qreal Preferences::getGlobalMaxRatio() const
|
qreal Preferences::getGlobalMaxRatio() const
|
||||||
{
|
{
|
||||||
return value("Preferences/Bittorrent/MaxRatio", -1).toDouble();
|
return value("Preferences/Bittorrent/MaxRatio", -1).toReal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preferences::setGlobalMaxRatio(qreal ratio)
|
void Preferences::setGlobalMaxRatio(qreal ratio)
|
||||||
|
@ -347,7 +347,7 @@ void prefjson::setPreferences(const QString& json)
|
|||||||
pref->setIgnoreSlowTorrentsForQueueing(m["dont_count_slow_torrents"].toBool());
|
pref->setIgnoreSlowTorrentsForQueueing(m["dont_count_slow_torrents"].toBool());
|
||||||
// Share Ratio Limiting
|
// Share Ratio Limiting
|
||||||
if (m.contains("max_ratio_enabled"))
|
if (m.contains("max_ratio_enabled"))
|
||||||
pref->setGlobalMaxRatio(m["max_ratio"].toInt());
|
pref->setGlobalMaxRatio(m["max_ratio"].toReal());
|
||||||
else
|
else
|
||||||
pref->setGlobalMaxRatio(-1);
|
pref->setGlobalMaxRatio(-1);
|
||||||
if (m.contains("max_ratio_act"))
|
if (m.contains("max_ratio_act"))
|
||||||
|
@ -964,7 +964,7 @@ loadPreferences = function() {
|
|||||||
// Share Ratio Limiting
|
// Share Ratio Limiting
|
||||||
$('max_ratio_checkbox').setProperty('checked', pref.max_ratio_enabled);
|
$('max_ratio_checkbox').setProperty('checked', pref.max_ratio_enabled);
|
||||||
if (pref.max_ratio_enabled)
|
if (pref.max_ratio_enabled)
|
||||||
$('max_ratio_value').setProperty('value', pref.max_ratio.toInt());
|
$('max_ratio_value').setProperty('value', pref.max_ratio);
|
||||||
else
|
else
|
||||||
$('max_ratio_value').setProperty('value', 1);
|
$('max_ratio_value').setProperty('value', 1);
|
||||||
var max_ratio_act = pref.max_ratio_act.toInt();
|
var max_ratio_act = pref.max_ratio_act.toInt();
|
||||||
@ -1211,7 +1211,7 @@ applyPreferences = function() {
|
|||||||
// Share Ratio Limiting
|
// Share Ratio Limiting
|
||||||
var max_ratio = -1;
|
var max_ratio = -1;
|
||||||
if($('max_ratio_checkbox').getProperty('checked')) {
|
if($('max_ratio_checkbox').getProperty('checked')) {
|
||||||
max_ratio = $('max_ratio_value').getProperty('value').toInt();
|
max_ratio = $('max_ratio_value').getProperty('value');
|
||||||
if(isNaN(max_ratio) || max_ratio < 0 || max_ratio > 9998) {
|
if(isNaN(max_ratio) || max_ratio < 0 || max_ratio > 9998) {
|
||||||
alert("QBT_TR(Share ratio limit must be between 0 and 9998.)QBT_TR");
|
alert("QBT_TR(Share ratio limit must be between 0 and 9998.)QBT_TR");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user