From e937b89191963d5310d7d6823090bf270db90ae8 Mon Sep 17 00:00:00 2001 From: Till Theato Date: Thu, 30 Jun 2011 21:22:52 +0000 Subject: [PATCH] Fix list parameters sometimes incorrectly loaded. This happened when internally double was used to present the list parameter. When the first or last item was selected (0, 1) and in the xml description it was stored as '0.0' and '1.0' (for consistency with the values inbetween) converting it to double and then to string again made it '0' and '1'. svn path=/trunk/kdenlive/; revision=5752 --- src/trackview.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/trackview.cpp b/src/trackview.cpp index b5b2b9ef..f42104b9 100644 --- a/src/trackview.cpp +++ b/src/trackview.cpp @@ -844,6 +844,7 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo for (int k = 0; k < clipeffectparams.count(); k++) { e = clipeffectparams.item(k).toElement(); if (!e.isNull() && e.tagName() == "parameter" && e.attribute("name") == paramname) { + QString type = e.attribute("type"); QString factor = e.attribute("factor", "1"); double fact; if (factor.startsWith('%')) { @@ -851,7 +852,7 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo } else { fact = factor.toDouble(); } - if (e.attribute("type") == "simplekeyframe") { + if (type == "simplekeyframe") { QStringList kfrs = paramvalue.split(";"); for (int l = 0; l < kfrs.count(); l++) { QString fr = kfrs.at(l).section('=', 0, 0); @@ -859,11 +860,13 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo kfrs[l] = fr + ":" + QString::number((int)(val * fact)); } e.setAttribute("keyframes", kfrs.join(";")); - } else { + } else if (type == "double" || type == "constant") { bool ok; e.setAttribute("value", paramvalue.toDouble(&ok) * fact); if (!ok) e.setAttribute("value", paramvalue); + } else { + e.setAttribute("value", paramvalue); } break; } -- 2.39.5