Commit 59a69978 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Upgrade document version and fix wipe params for MLT 7 when opening older project file

parent 8f54fb2a
......@@ -1741,6 +1741,24 @@ bool DocumentValidator::upgrade(double version, const double currentVersion)
Xml::setXmlProperty(masterProducers.at(i).toElement(), QStringLiteral("kdenlive:clipzones"), QString(json.toJson()));
}
}
if (version < 1.01) {
// Upgrade wipe composition (replace old mlt geometry with mlt rect
// Warn about deprecated automask
// Some tracks were added, adjust compositions
QDomNodeList transitions = m_doc.elementsByTagName(QStringLiteral("transition"));
int max = transitions.count();
for (int i = 0; i < max; ++i) {
QDomElement t = transitions.at(i).toElement();
if (Xml::getXmlProperty(t, QStringLiteral("kdenlive_id")) == QLatin1String("wipe")) {
QString animation = Xml::getXmlProperty(t, QStringLiteral("geometry"));
if (animation == QLatin1String("0%/0%:100%x100%:100;-1=0%/0%:100%x100%:0")) {
Xml::setXmlProperty(t, QStringLiteral("geometry"), QStringLiteral("0=0% 0% 100% 100% 1;-1=0% 0% 100% 100% 0"));
} else if (animation == QLatin1String("0%/0%:100%x100%:0;-1=0%/0%:100%x100%:100")) {
Xml::setXmlProperty(t, QStringLiteral("geometry"), QStringLiteral("0=0% 0% 100% 100% 0;-1=0% 0% 100% 100% 1"));
}
}
}
}
m_modified = true;
return true;
}
......
......@@ -68,7 +68,7 @@
#include <xlocale.h>
#endif
const double DOCUMENTVERSION = 1.00;
const double DOCUMENTVERSION = 1.01;
KdenliveDoc::KdenliveDoc(const QUrl &url, QString projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap<QString, QString> &properties,
const QMap<QString, QString> &metadata, const QPair<int, int> &tracks, int audioChannels, bool *openBackup, MainWindow *parent)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment