]> git.sesse.net Git - kdenlive/commitdiff
Fix crash on wrongly detected document version:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 15 Nov 2012 20:30:01 +0000 (21:30 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 15 Nov 2012 20:30:01 +0000 (21:30 +0100)
http://kdenlive.org/mantis/view.php?id=2828

src/documentvalidator.cpp

index a0775b5c68636589f152f2a0b594e8300c8a6463..dea1e96794c49da2e27e727f5c7d178588d517c6 100644 (file)
@@ -112,7 +112,13 @@ bool DocumentValidator::validate(const double currentVersion)
        QLocale tempLocale = QLocale(mlt.attribute("LC_NUMERIC"));
        version = tempLocale.toDouble(kdenliveDoc.attribute("version"), &ok);
        if (!ok) version = kdenliveDoc.attribute("version").toDouble(&ok);
-       if (!ok) kDebug()<<"// CANNOT PARSE VERSION NUMBER, ERROR!";
+       if (!ok) {
+           // Last try: replace comma with a dot
+           QString versionString = kdenliveDoc.attribute("version");
+           if (versionString.contains(',')) versionString.replace(',', '.');
+           version = versionString.toDouble(&ok);
+           if (!ok) kDebug()<<"// CANNOT PARSE VERSION NUMBER, ERROR!";
+       }
     }
     
     // Upgrade the document to the latest version