if (KIO::NetAccess::exists(file, KIO::NetAccess::SourceSide, NULL)) {
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
+ doc.appendChild(prod);
if (!group.isEmpty()) {
prod.setAttribute("groupname", group);
prod.setAttribute("groupid", groupId);
prod.setAttribute("in", "0");
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()) - 1);
}
- new AddClipCommand(m_doc, prod, QString::number(id), true, addClips);
+ new AddClipCommand(m_doc, doc.documentElement(), QString::number(id), true, addClips);
}
}
m_doc->commandStack()->push(addClips);
kDebug() << "///// CLIP MANAGER, ADDING CLIP: " << url;
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
+ doc.appendChild(prod);
prod.setAttribute("resource", url.path());
uint id = m_clipIdCounter++;
prod.setAttribute("id", QString::number(id));
prod.setAttribute("in", "0");
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()) - 1);
}
- AddClipCommand *command = new AddClipCommand(m_doc, prod, QString::number(id), true);
+ AddClipCommand *command = new AddClipCommand(m_doc, doc.documentElement(), QString::number(id), true);
m_doc->commandStack()->push(command);
}
void ClipManager::slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const QString &groupId) {
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
+ doc.appendChild(prod);
prod.setAttribute("mlt_service", "colour");
prod.setAttribute("colour", color);
prod.setAttribute("type", (int) COLOR);
prod.setAttribute("groupname", group);
prod.setAttribute("groupid", groupId);
}
- AddClipCommand *command = new AddClipCommand(m_doc, prod, QString::number(id), true);
+ AddClipCommand *command = new AddClipCommand(m_doc, doc.documentElement(), QString::number(id), true);
m_doc->commandStack()->push(command);
}
void ClipManager::slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, QString group, const QString &groupId) {
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
+ doc.appendChild(prod);
prod.setAttribute("resource", path);
prod.setAttribute("type", (int) SLIDESHOW);
uint id = m_clipIdCounter++;
prod.setAttribute("groupname", group);
prod.setAttribute("groupid", groupId);
}
- AddClipCommand *command = new AddClipCommand(m_doc, prod, QString::number(id), true);
+ AddClipCommand *command = new AddClipCommand(m_doc, doc.documentElement(), QString::number(id), true);
m_doc->commandStack()->push(command);
}
void ClipManager::slotAddTextClipFile(const QString titleName, const QString imagePath, const QString xml, const QString group, const QString &groupId) {
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
+ doc.appendChild(prod);
prod.setAttribute("resource", imagePath);
prod.setAttribute("titlename", titleName);
prod.setAttribute("xmldata", xml);
prod.setAttribute("transparency", "1");
prod.setAttribute("in", "0");
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()) - 1);
- AddClipCommand *command = new AddClipCommand(m_doc, prod, QString::number(id), true);
+ AddClipCommand *command = new AddClipCommand(m_doc, doc.documentElement(), QString::number(id), true);
m_doc->commandStack()->push(command);
}
connect(listView, SIGNAL(pauseMonitor()), this, SLOT(slotPauseMonitor()));
connect(listView, SIGNAL(requestMenu(const QPoint &, QTreeWidgetItem *)), this, SLOT(slotContextMenu(const QPoint &, QTreeWidgetItem *)));
connect(listView, SIGNAL(addClip()), this, SLOT(slotAddClip()));
- connect(listView, SIGNAL(addClip(KUrl, const QString &)), this, SLOT(slotAddClip(KUrl, const QString &)));
+ connect(listView, SIGNAL(addClip(const QList <QUrl>, const QString &)), this, SLOT(slotAddClip(const QList <QUrl>, const QString &)));
connect(listView, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotItemEdited(QTreeWidgetItem *, int)));
connect(listView, SIGNAL(showProperties(DocClipBase *)), this, SIGNAL(showClipProperties(DocClipBase *)));
QTimer::singleShot(500, this, SLOT(slotCheckForEmptyQueue()));
}
-void ProjectList::slotAddClip(KUrl givenUrl, QString group) {
+void ProjectList::slotAddClip(const QList <QUrl> givenList, QString group) {
if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
KUrl::List list;
- if (givenUrl.isEmpty()) {
+ if (givenList.isEmpty()) {
list = KFileDialog::getOpenUrls(KUrl("kfiledialog:///clipfolder"), "application/x-kdenlive video/x-flv application/vnd.rn-realmedia video/x-dv video/dv video/x-msvideo video/x-matroska video/mpeg video/x-ms-wmv audio/mpeg audio/x-mp3 audio/x-wav application/ogg video/mp4 video/quicktime image/gif image/jpeg image/png image/x-tga image/x-bmp image/svg+xml image/tiff image/x-xcf-gimp image/x-vnd.adobe.photoshop image/x-pcx image/x-exr video/mlt-playlist audio/x-flac audio/mp4 video/x-matroska audio/x-matroska", this);
- } else list.append(givenUrl);
+ } else {
+ for (int i = 0; i < givenList.count(); i++)
+ list << givenList.at(i);
+ }
if (list.isEmpty()) return;
QString groupId;