From c4b468f0c71c930aff41fed32108e69e59a2fef9 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Thu, 15 Nov 2012 21:30:01 +0100 Subject: [PATCH] Fix crash on wrongly detected document version: http://kdenlive.org/mantis/view.php?id=2828 --- src/documentvalidator.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/documentvalidator.cpp b/src/documentvalidator.cpp index a0775b5c..dea1e967 100644 --- a/src/documentvalidator.cpp +++ b/src/documentvalidator.cpp @@ -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 -- 2.39.5