- if (parentId != -1) {
- groupItem = getItemById(parentId);
- } else if (!groupName.isEmpty()) {
- // Clip is in a group
- QList<QTreeWidgetItem *> groupList = listView->findItems(groupName, Qt::MatchExactly, 1);
-
- if (groupList.isEmpty()) {
- QStringList itemName;
- itemName << QString::null << groupName;
- kDebug() << "------- CREATING NEW GRP: " << itemName;
- groupItem = new ProjectItem(listView, itemName, m_doc->getFreeClipId());
- } else groupItem = (ProjectItem *) groupList.first();
- }
- if (groupItem) item = new ProjectItem(groupItem, name, elem, clipId);
- else item = new ProjectItem(listView, name, elem, clipId);
- if (!url.isEmpty()) {
- // if file has Nepomuk comment, use it
- Nepomuk::Resource f(url.path());
- QString annotation;
- if (f.isValid()) annotation = f.description();
-
- if (!annotation.isEmpty()) item->setText(2, annotation);
- QString resource = url.path();
- if (resource.endsWith("westley") || resource.endsWith("kdenlive")) {
- QString tmpfile;
- QDomDocument doc;
- if (KIO::NetAccess::download(url, tmpfile, 0)) {
- QFile file(tmpfile);
- if (file.open(QIODevice::ReadOnly)) {
- doc.setContent(&file, false);
- file.close();
- }
- KIO::NetAccess::removeTempFile(tmpfile);
-
- QDomNodeList subProds = doc.elementsByTagName("producer");
- int ct = subProds.count();
- for (int i = 0; i < ct ; i++) {
- QDomElement e = subProds.item(i).toElement();
- if (!e.isNull()) {
- addProducer(e, clipId);
- }
- }
- }
- }
-
- }
-
- if (elem.isNull()) {
- QDomDocument doc;
- QDomElement element = doc.createElement("producer");
- element.setAttribute("resource", url.path());
- emit getFileProperties(element, clipId);
- } else emit getFileProperties(elem, clipId);
- selectItemById(clipId);
-}
-
-void ProjectList::slotDeleteClip(int clipId) {