Commit 95193a44 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix effect presets broken on comma locales, clear preset after resetting effect

Fixes #303
parent a8e74a7f
Pipeline #6320 passed with stage
in 15 minutes and 25 seconds
......@@ -601,7 +601,7 @@ QJsonDocument AssetParameterModel::toJson(bool includeFixed) const
QJsonObject currentParam;
QModelIndex ix = index(m_rows.indexOf(fixed.first), 0);
currentParam.insert(QLatin1String("name"), QJsonValue(fixed.first));
currentParam.insert(QLatin1String("value"), fixed.second.toString());
currentParam.insert(QLatin1String("value"), fixed.second.type() == QVariant::Double ? QJsonValue(fixed.second.toDouble()) : QJsonValue(fixed.second.toString()));
int type = data(ix, AssetParameterModel::TypeRole).toInt();
double min = data(ix, AssetParameterModel::MinRole).toDouble();
double max = data(ix, AssetParameterModel::MaxRole).toDouble();
......@@ -628,7 +628,7 @@ QJsonDocument AssetParameterModel::toJson(bool includeFixed) const
QJsonObject currentParam;
QModelIndex ix = index(m_rows.indexOf(param.first), 0);
currentParam.insert(QLatin1String("name"), QJsonValue(param.first));
currentParam.insert(QLatin1String("value"), QJsonValue(param.second.value.toString()));
currentParam.insert(QLatin1String("value"), param.second.value.type() == QVariant::Double ? QJsonValue(param.second.value.toDouble()) : QJsonValue(param.second.value.toString()));
int type = data(ix, AssetParameterModel::TypeRole).toInt();
double min = data(ix, AssetParameterModel::MinRole).toDouble();
double max = data(ix, AssetParameterModel::MaxRole).toDouble();
......
......@@ -142,9 +142,11 @@ void AssetParameterView::resetValues()
const QVector<QPair<QString, QVariant>> values = getDefaultValues();
auto *command = new AssetUpdateCommand(m_model, values);
pCore->pushUndo(command);
/*if (m_mainKeyframeWidget) {
m_mainKeyframeWidget->resetKeyframes();
}*/
// Unselect preset if any
QAction *ac = m_presetGroup->checkedAction();
if (ac) {
ac->setChecked(false);;
}
}
void AssetParameterView::commitChanges(const QModelIndex &index, const QString &value, bool storeUndo)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment