Git commit 2087c0236360e0bf3387f0117c7a9c273ba199e8 by Jean-Baptiste Mardel= le. Committed on 30/11/2016 at 16:00. Pushed by mardelle into branch 'Applications/16.12'. Reloading a playlist clip in a project now checks for missing files in it a= nd allows fixing M +23 -0 src/bin/bin.cpp https://commits.kde.org/kdenlive/2087c0236360e0bf3387f0117c7a9c273ba199e8 diff --git a/src/bin/bin.cpp b/src/bin/bin.cpp index 322b3ff..37ee81a 100644 --- a/src/bin/bin.cpp +++ b/src/bin/bin.cpp @@ -863,6 +863,29 @@ void Bin::slotReloadClip() ProjectClip *currentItem =3D qobject_cast(item); if (currentItem) { emit openClip(NULL); + if (currentItem->clipType() =3D=3D Playlist) { + //Check if a clip inside playlist is missing + QString path =3D currentItem->url().path(); = + QFile f(path); + QDomDocument doc; + doc.setContent(&f, false); + f.close(); + DocumentChecker d(QUrl::fromLocalFile(path), doc); + if (!d.hasErrorInClips() && doc.documentElement().attribut= e(QStringLiteral("modified")) =3D=3D QLatin1String("1")) { + QString backupFile =3D path + QStringLiteral(".backup"= ); + KIO::FileCopyJob *copyjob =3D KIO::file_copy(QUrl::fro= mLocalFile(path), QUrl::fromLocalFile(backupFile)); + if (copyjob->exec()) { + if (!f.open(QIODevice::WriteOnly | QIODevice::Text= )) { + KMessageBox::sorry(this, i18n("Unable to write= to file %1", path)); + } else { + QTextStream out(&f); + out << doc.toString(); + f.close(); + KMessageBox::information(this, i18n("Your proj= ect file was modified by Kdenlive.\nTo make sure you don't lose data, a bac= kup copy called %1 was created.", backupFile)); + } + } + } + } = QDomDocument doc; QDomElement xml =3D currentItem->toXml(doc); qDebug()<<"*****************\n"<