}
else {
// Creating new document
- /*QDomElement westley = m_document.createElement("westley");
+ QDomElement westley = m_document.createElement("westley");
m_document.appendChild(westley);
QDomElement doc = m_document.createElement("kdenlivedoc");
doc.setAttribute("version", "0.6");
doc.setAttribute("width", m_width);
doc.setAttribute("height", m_height);
doc.setAttribute("projectfps", m_fps);
- doc.appendChild(props);*/
+ doc.appendChild(props);
- QDomElement westley = m_document.createElement("westley");
- m_document.appendChild(westley);
+ /*QDomElement westley = m_document.createElement("westley");
+ m_document.appendChild(westley);*/
QDomElement prod = m_document.createElement("producer");
prod.setAttribute("resource", "colour");
prod.setAttribute("colour", "red");
playlist5.setAttribute("hide", "video");
multitrack.appendChild(playlist5);
tractor.appendChild(multitrack);
- westley.appendChild(tractor);
+ doc.appendChild(tractor);
}
if (fps == 30000.0 / 1001.0 ) m_timecode.setFormat(30, true);
QDomNodeList list = m_document.elementsByTagName("producer");
int ct = list.count();
kDebug()<<"DELETING CHILD PRODUCERS: "<<ct;
- for (int i = 0; i < ct; i++) {
- kdenlivedocument.removeChild(list.item(0));
+ for (int i = ct; i > 0; i--) {
+ kdenlivedocument.removeChild(list.item(i));
}
QDomNode n = doc.firstChild();
{
setSizeHint(0, QSize(65, 45));
setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
- if (m_element.isNull()) m_element.setAttribute("id", clipId);
- QString cType = m_element.attribute("type", 0);
- if (!cType.isEmpty()) {
- m_clipType = (DocClipBase::CLIPTYPE) cType.toInt();
- slotSetToolTip();
+ if (!m_element.isNull()) {
+ m_element.setAttribute("id", clipId);
+ QString cType = m_element.attribute("type", QString::null);
+ if (!cType.isEmpty()) {
+ m_clipType = (DocClipBase::CLIPTYPE) cType.toInt();
+ slotSetToolTip();
+ }
}
}
//extend attributes -reh
- if (attributes.contains("type")) {
+
+ if (m_clipType == DocClipBase::NONE) {
+ if (attributes.contains("type")) {
if (attributes["type"] == "audio")
m_clipType = DocClipBase::AUDIO;
else if (attributes["type"] == "video")
m_clipType = DocClipBase::AV;
else if (attributes["type"] == "playlist")
m_clipType = DocClipBase::PLAYLIST;
- } else {
+ } else {
m_clipType = DocClipBase::AV;
+ }
}
slotSetToolTip();
void ProjectList::addClip(const QStringList &name, const QDomElement &elem, const int clipId, const KUrl &url)
{
+ kDebug()<<"///////// ADDING VCLIP=: "<<name;
ProjectItem *item = new ProjectItem(listView, name, elem, clipId);
if (!url.isEmpty()) {
item->setData(1, FullPathRole, url.path());
m_timecode = doc->timecode();
m_commandStack = doc->commandStack();
QDomNodeList prods = doc->producersList();
+ int ct = prods.count();
+ kDebug()<<"//////////// SETTING DOC, FOUND CLIPS: "<<prods.count();
listView->clear();
- for (int i = 0; i < prods.count () ; i++)
+ for (int i = 0; i < ct ; i++)
{
- addProducer(prods.item(i).toElement());
+ QDomElement e = prods.item(i).cloneNode().toElement();
+ kDebug()<<"// IMPORT: "<<i<<", :"<<e.attribute("id", "non")<<", NAME: "<<e.attribute("name", "non");
+ if (!e.isNull()) addProducer(e);
}
QTreeWidgetItem *first = listView->topLevelItem(0);
if (first) listView->setCurrentItem(first);
{
QTreeWidgetItem *item =
parent ? parent->child(i) : listView->topLevelItem(i);
- prods.appendChild(doc.importNode(((ProjectItem *)item)->toXml(), true));
+ prods.appendChild(doc.importNode(((ProjectItem *)item)->toXml(), true));
}
return prods;
{
DocClipBase::CLIPTYPE type = (DocClipBase::CLIPTYPE) producer.attribute("type").toInt();
- QDomDocument doc;
+ /*QDomDocument doc;
QDomElement prods = doc.createElement("list");
- prods.appendChild(doc.importNode(producer, true));
+ doc.appendChild(prods);
+ prods.appendChild(doc.importNode(producer, true));*/
- kDebug()<<"////// ADDING PRODUCER:\n "<<doc.toString()<<"\n+++++++++++++++++";
+ //kDebug()<<"////// ADDING PRODUCER:\n "<<doc.toString()<<"\n+++++++++++++++++";
int id = producer.attribute("id").toInt();
if (id >= m_clipIdCounter) m_clipIdCounter = id + 1;