]> git.sesse.net Git - kdenlive/commitdiff
Fix list parameters sometimes incorrectly loaded.
authorTill Theato <root@ttill.de>
Thu, 30 Jun 2011 21:22:52 +0000 (21:22 +0000)
committerTill Theato <root@ttill.de>
Thu, 30 Jun 2011 21:22:52 +0000 (21:22 +0000)
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

index b5b2b9efd173d318e5b0a7bb4b14cbc7941663ec..f42104b9b48152ffdc90e89fb566a813c3235439 100644 (file)
@@ -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;
                     }