From: Alberto Villa Date: Sat, 9 May 2009 14:54:54 +0000 (+0000) Subject: fix producers resources when searching missing files: X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=599491820e916b008662d90972e4927fca743253;p=kdenlive fix producers resources when searching missing files: http://www.kdenlive.org/mantis/view.php?id=805 (?) svn path=/trunk/kdenlive/; revision=3370 --- diff --git a/src/documentchecker.cpp b/src/documentchecker.cpp index 3444503f..e4cb7059 100644 --- a/src/documentchecker.cpp +++ b/src/documentchecker.cpp @@ -49,7 +49,8 @@ const int CLIPOK = 1; const int CLIPPLACEHOLDER = 2; DocumentChecker::DocumentChecker(QDomNodeList producers, QDomNodeList infoproducers, QList missingClips, QDomDocument doc, QWidget * parent) : - QDialog(parent), m_doc(doc) + QDialog(parent), + m_doc(doc) { setFont(KGlobalSettings::toolBarFont()); m_view.setupUi(this); @@ -170,9 +171,10 @@ void DocumentChecker::slotEditItem(QTreeWidgetItem *item, int) // virtual void DocumentChecker::accept() { - QDomElement e; + QDomElement e, property; QDomNodeList producers = m_doc.elementsByTagName("producer"); QDomNodeList infoproducers = m_doc.elementsByTagName("kdenlive_producer"); + QDomNodeList properties; int ix = 0; QTreeWidgetItem *child = m_view.treeWidget->topLevelItem(ix); while (child) { @@ -188,9 +190,16 @@ void DocumentChecker::accept() } for (int i = 0; i < producers.count(); i++) { e = producers.item(i).toElement(); - if (e.attribute("id") == id) { + if (e.attribute("id").section('_', 0, 0) == id) { // Fix clip - e.setAttribute("resource", child->text(1)); + properties = e.childNodes(); + for (int j = 0; j < properties.count(); ++j) { + property = properties.item(j).toElement(); + if (property.attribute("name") == "resource") { + property.firstChild().setNodeValue(child->text(1)); + break; + } + } break; } }