}
westley.removeChild(tracksinfo);
}
- checkDocumentClips();
QDomNodeList producers = m_document.elementsByTagName("producer");
QDomNodeList infoproducers = m_document.elementsByTagName("kdenlive_producer");
+ if (checkDocumentClips(producers, infoproducers) == false) m_abortLoading = true;
const int max = producers.count();
const int infomax = infoproducers.count();
{
const QString producerId = clipId.section('_', 0, 0);
DocClipBase *clip = m_clipManager->getClipById(producerId);
- bool placeHolder = false;
+
if (clip == NULL) {
elem.setAttribute("id", producerId);
QString path = elem.attribute("resource");
delete dia_ui;
}
- if (path.isEmpty() == false && QFile::exists(path) == false && elem.attribute("type").toInt() != TEXT) {
+ if (path.isEmpty() == false && QFile::exists(path) == false && elem.attribute("type").toInt() != TEXT && !elem.hasAttribute("placeholder")) {
kDebug() << "// FOUND MISSING CLIP: " << path << ", TYPE: " << elem.attribute("type").toInt();
const QString size = elem.attribute("file_size");
const QString hash = elem.attribute("file_hash");
return;
} else if (action == KMessageBox::No) {
// Keep clip as placeHolder
- placeHolder = true;
+ elem.setAttribute("placeholder", '1');
}
if (!newpath.isEmpty()) {
if (elem.attribute("type").toInt() == SLIDESHOW) newpath.append('/' + extension);
setModified(true);
}
}
- clip = new DocClipBase(m_clipManager, elem, producerId, placeHolder);
+ clip = new DocClipBase(m_clipManager, elem, producerId);
m_clipManager->addClip(clip);
}
return m_projectFolder.path() + "/ladspa/" + counter + ".ladspa";
}
-void KdenliveDoc::checkDocumentClips()
+bool KdenliveDoc::checkDocumentClips(QDomNodeList producers, QDomNodeList infoproducers)
{
- DocumentChecker d(m_document);
- d.exec();
+ int clipType;
+ QDomElement e;
+ QString id;
+ QString resource;
+ QList <QDomElement> missingClips;
+ for (int i = 0; i < infoproducers.count(); i++) {
+ e = infoproducers.item(i).toElement();
+ clipType = e.attribute("type").toInt();
+ if (clipType == TEXT) continue;
+ id = e.attribute("id");
+ resource = e.attribute("resource");
+ if (clipType == SLIDESHOW) resource = KUrl(resource).directory();
+ if (!KIO::NetAccess::exists(KUrl(resource), KIO::NetAccess::SourceSide, 0)) {
+ // Missing clip found
+ missingClips.append(e);
+ }
+ }
+ if (missingClips.isEmpty()) return true;
+ DocumentChecker d(producers, infoproducers, missingClips, m_document);
+ return (d.exec() == QDialog::Accepted);
}