summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-12-04 20:35:56 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-12-04 20:35:56 (GMT)
commit12d1eb7ca5bd24ad88115c5cb6321f6a86cbe3d2 (patch)
tree08b61cab44cdebb308fce0c3a0f57923594f6e93
parent42701f3986ee99f4be470ddd4ab5d2fc8e731fc2 (diff)
Make sure the document has a valid id on opening
-rw-r--r--src/doc/documentchecker.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/doc/documentchecker.cpp b/src/doc/documentchecker.cpp
index 0900085..b4602b2 100644
--- a/src/doc/documentchecker.cpp
+++ b/src/doc/documentchecker.cpp
@@ -87,6 +87,12 @@ bool DocumentChecker::hasErrorInClips()
for (int i = 0; i < playlists.count(); ++i) {
if (playlists.at(i).toElement().attribute(QStringLiteral("id")) == QStringLiteral("main bin")) {
QString documentid = EffectsList::property(playlists.at(i).toElement(), QStringLiteral("kdenlive:docproperties.documentid"));
+ if (documentid.isEmpty()) {
+ // invalid document id, recreate one
+ documentid = QString::number(QDateTime::currentMSecsSinceEpoch());
+ //TODO: Warn on invalid doc id
+ EffectsList::setProperty(playlists.at(i).toElement(), QStringLiteral("kdenlive:docproperties.documentid"), documentid);
+ }
storageFolder = EffectsList::property(playlists.at(i).toElement(), QStringLiteral("kdenlive:docproperties.storagefolder"));
if (!storageFolder.isEmpty() && !!storageFolder.startsWith(QStringLiteral("/"))) {
storageFolder.prepend(root);