From 52db76267786b30e0d2c6f788e35966746e73246 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Mon, 19 Oct 2015 21:14:41 +0300 Subject: [PATCH] Cast MaxRatioAction to int when store as JSON. Closes #3939. --- src/webui/prefjson.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webui/prefjson.cpp b/src/webui/prefjson.cpp index f08385463..27d7e9ac3 100644 --- a/src/webui/prefjson.cpp +++ b/src/webui/prefjson.cpp @@ -141,7 +141,7 @@ QByteArray prefjson::getPreferences() // Share Ratio Limiting data["max_ratio_enabled"] = (pref->getGlobalMaxRatio() >= 0.); data["max_ratio"] = pref->getGlobalMaxRatio(); - data["max_ratio_act"] = QVariant::fromValue(pref->getMaxRatioAction()); + data["max_ratio_act"] = static_cast(pref->getMaxRatioAction()); // Web UI // Language @@ -337,7 +337,7 @@ void prefjson::setPreferences(const QString& json) else pref->setGlobalMaxRatio(-1); if (m.contains("max_ratio_act")) - pref->setMaxRatioAction(m["max_ratio_act"].value()); + pref->setMaxRatioAction(static_cast(m["max_ratio_act"].toInt())); // Web UI // Language