mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-03 02:14:16 +00:00
Merge pull request #3967 from glassez/webui
Cast MaxRatioAction to int when store as JSON. Closes #3939.
This commit is contained in:
commit
0507876080
@ -141,7 +141,7 @@ QByteArray prefjson::getPreferences()
|
|||||||
// Share Ratio Limiting
|
// Share Ratio Limiting
|
||||||
data["max_ratio_enabled"] = (pref->getGlobalMaxRatio() >= 0.);
|
data["max_ratio_enabled"] = (pref->getGlobalMaxRatio() >= 0.);
|
||||||
data["max_ratio"] = pref->getGlobalMaxRatio();
|
data["max_ratio"] = pref->getGlobalMaxRatio();
|
||||||
data["max_ratio_act"] = QVariant::fromValue(pref->getMaxRatioAction());
|
data["max_ratio_act"] = static_cast<int>(pref->getMaxRatioAction());
|
||||||
|
|
||||||
// Web UI
|
// Web UI
|
||||||
// Language
|
// Language
|
||||||
@ -337,7 +337,7 @@ void prefjson::setPreferences(const QString& json)
|
|||||||
else
|
else
|
||||||
pref->setGlobalMaxRatio(-1);
|
pref->setGlobalMaxRatio(-1);
|
||||||
if (m.contains("max_ratio_act"))
|
if (m.contains("max_ratio_act"))
|
||||||
pref->setMaxRatioAction(m["max_ratio_act"].value<MaxRatioAction>());
|
pref->setMaxRatioAction(static_cast<MaxRatioAction>(m["max_ratio_act"].toInt()));
|
||||||
|
|
||||||
// Web UI
|
// Web UI
|
||||||
// Language
|
// Language
|
||||||
|
Loading…
x
Reference in New Issue
Block a user