]> git.sesse.net Git - kdenlive/commitdiff
Use the effect id as the filename for update scripts.
authorTill Theato <root@ttill.de>
Wed, 7 Sep 2011 16:14:42 +0000 (16:14 +0000)
committerTill Theato <root@ttill.de>
Wed, 7 Sep 2011 16:14:42 +0000 (16:14 +0000)
Don't use '_' instead of '.' (Prevents possible misinterpretations)

svn path=/trunk/kdenlive/; revision=5861

effects/update/CMakeLists.txt
effects/update/frei0r.levels.js [new file with mode: 0644]
src/documentvalidator.cpp

index 67af8114633e114ac93b3dfc5dfd21513517800b..d69ab9cbfad0ccd3d64ddefac45d8863bc761645 100644 (file)
@@ -1,4 +1,4 @@
 INSTALL(FILES
 
-frei0r_levels.js
+frei0r.levels.js
 DESTINATION ${DATA_INSTALL_DIR}/kdenlive/effects/update)
diff --git a/effects/update/frei0r.levels.js b/effects/update/frei0r.levels.js
new file mode 100644 (file)
index 0000000..279ae2f
--- /dev/null
@@ -0,0 +1,23 @@
+
+function update(serviceVersion, effectVersion, effectString) {
+    var locale = new QLocale();
+    var doc = new QDomDocument();
+    doc.setContent(effectString);
+    for (var node = doc.documentElement().firstChild(); !node.isNull(); node = node.nextSibling()) {
+        var effectparam = node.toElement();
+        if (effectparam.attribute("name") == "Channel" || effectparam.attribute("name") == "Histogram position") {
+            if (serviceVersion < effectVersion) {
+                // downgrade
+                if (effectVersion > 0.1) {
+                    effectparam.firstChild().toText().setData(locale.toString(effectparam.text() * 10));
+                }
+            } else {
+                // upgrade
+                if (effectVersion < 0.2) { 
+                    effectparam.firstChild().toText().setData(locale.toString(effectparam.text() / 10.));
+                }
+            }
+        }
+    }
+    return doc.toString();
+}
index 7370009ed2b2bb5efb7e88c0623de9aaf61992e7..52bb70ca1a1b45d7fe1b1456fccb8852d57ebba0 100644 (file)
@@ -1044,8 +1044,8 @@ void DocumentValidator::updateEffects()
         QStringList fileList = directory.entryList(QStringList() << "*.js", QDir::Files);
         foreach (const QString &fileName, fileList) {
             QString identifier = fileName;
+            // remove extension (".js")
             identifier.chop(3);
-            identifier.replace('_', '.');
             paths.insert(identifier, KUrl(directoryName + fileName));
         }
     }
@@ -1108,3 +1108,4 @@ void DocumentValidator::updateEffects()
     }
 }
 
+