From 6a9d55d77525831537ebe00573ecc4857eaf4e6c Mon Sep 17 00:00:00 2001 From: Alberto Villa Date: Sat, 20 Jun 2009 11:23:16 +0000 Subject: [PATCH] move zonein, zoneout and zoom from to when loading an old document svn path=/trunk/kdenlive/; revision=3602 --- src/documentvalidator.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/documentvalidator.cpp b/src/documentvalidator.cpp index 83727c76..8f9d9cd9 100644 --- a/src/documentvalidator.cpp +++ b/src/documentvalidator.cpp @@ -128,8 +128,8 @@ bool DocumentValidator::upgrade(double version, const double currentVersion) // No conversion needed if (version == currentVersion) { - if (!m_doc.toString().contains("font-size")) // TODO: remove when currentVersion == 0.84 - return true; + // TODO: uncomment when currentVersion == 0.84 + //return true; } // The document is too new @@ -674,8 +674,8 @@ bool DocumentValidator::upgrade(double version, const double currentVersion) if (version <= 0.83) { // Replace point size with pixel size in text titles - KMessageBox::ButtonCode convert; if (m_doc.toString().contains("font-size")) { + KMessageBox::ButtonCode convert; QDomNodeList kproducerNodes = m_doc.elementsByTagName("kdenlive_producer"); for (int i = 0; i < kproducerNodes.count() && convert != KMessageBox::No; ++i) { QDomElement kproducer = kproducerNodes.at(i).toElement(); @@ -709,6 +709,16 @@ bool DocumentValidator::upgrade(double version, const double currentVersion) } } } + + // Fill the element + QDomElement docProperties = infoXml.firstChildElement("documentproperties"); + if (docProperties.isNull()) { + docProperties = m_doc.createElement("documentproperties"); + docProperties.setAttribute("zonein", infoXml.attribute("zonein")); + docProperties.setAttribute("zoneout", infoXml.attribute("zoneout")); + docProperties.setAttribute("zoom", infoXml.attribute("zoom")); + infoXml.appendChild(docProperties); + } } // The document has been converted: mark it as modified -- 2.39.5