X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fdocumentvalidator.cpp;h=3cc588b8d96fb9c6024ec7cb642d27229d713bee;hb=d1e6242c20436bfa1ac8d1c3a5dc9f55bd8f10ca;hp=fc46f14fa37b101afaef192c748c75304f147c60;hpb=dad333cf334163a1752f87c11ce7e6a4b8a053cb;p=kdenlive diff --git a/src/documentvalidator.cpp b/src/documentvalidator.cpp index fc46f14f..3cc588b8 100644 --- a/src/documentvalidator.cpp +++ b/src/documentvalidator.cpp @@ -20,6 +20,7 @@ #include "documentvalidator.h" #include "definitions.h" +#include "initeffects.h" #include #include @@ -55,17 +56,18 @@ bool DocumentValidator::validate(const double currentVersion) if (mlt.hasAttribute("LC_NUMERIC")) { // Set locale for the document documentLocale = QLocale(mlt.attribute("LC_NUMERIC")); - if (documentLocale.decimalPoint() != QLocale().decimalPoint()) { - QDomElement docProperties = kdenliveDoc.firstChildElement("documentproperties"); - if (docProperties.isNull()) { - docProperties = m_doc.createElement("documentproperties"); - kdenliveDoc.appendChild(docProperties); - } - docProperties.setAttribute("readonly", 1); - KMessageBox::sorry(kapp->activeWindow(), i18n("The document you are opening uses a different locale (%1) than your system. You can only open and render it, no editing is supported unless you change your system's locale.", mlt.attribute("LC_NUMERIC")), i18n("Read only project")); - } } + if (documentLocale != QLocale()) { + QLocale::setDefault(documentLocale); + // locale conversion might need to be redone + initEffects::parseEffectFiles(); + } + + // TODO: remove after string freeze + if (0) + KMessageBox::sorry(kapp->activeWindow(), i18n("The document you are opening uses a different locale (%1) than your system. You can only open and render it, no editing is supported unless you change your system's locale.", mlt.attribute("LC_NUMERIC")), i18n("Read only project")); + // Upgrade the document to the latest version if (!upgrade(documentLocale.toDouble(kdenliveDoc.attribute("version")), currentVersion)) return false; @@ -906,6 +908,12 @@ bool DocumentValidator::upgrade(double version, const double currentVersion) } } + if (version <= 0.87) { + if (!m_doc.firstChildElement("mlt").hasAttribute("LC_NUMERIC")) { + m_doc.firstChildElement("mlt").setAttribute("LC_NUMERIC", "C"); + } + } + // The document has been converted: mark it as modified infoXml.setAttribute("version", currentVersion); m_modified = true;