if (!item) emit addClip();
else if (item->isGroup()) {
if ((columnAt(event->pos().x()) == 1)) QTreeWidget::mouseDoubleClickEvent(event);
- } else emit showProperties(item->referencedClip());
+ } else {
+ if ((columnAt(event->pos().x()) == 2)) QTreeWidget::mouseDoubleClickEvent(event);
+ else emit showProperties(item->referencedClip());
+ }
}
// virtual
}
const QList <QUrl> list = event->mimeData()->urls();
foreach(const QUrl &url, list) {
- emit addClip(url, groupName);
+ emit addClip(KUrl(url), groupName);
}
} else if (event->mimeData()->hasFormat("kdenlive/producerslist")) {
QTreeWidgetItem *parent = it->parent();
if (parent/* && ((ProjectItem *) it)->clipId() < 10000*/) {
kDebug() << "++ item parent: " << parent->text(1);
- clone = (ProjectItem*) parent->takeChild(parent->indexOfChild(it));
- if (clone) addTopLevelItem(clone);
+ clone = static_cast <ProjectItem*>(parent->takeChild(parent->indexOfChild(it)));
+ if (clone) {
+ addTopLevelItem(clone);
+ clone->clearProperty("groupname");
+ clone->clearProperty("groupid");
+ }
}
}
}
// virtual
void ProjectListView::mouseMoveEvent(QMouseEvent *event) {
- kDebug() << "// DRAG STARTED, MOUSE MOVED: ";
+ //kDebug() << "// DRAG STARTED, MOUSE MOVED: ";
if (!m_dragStarted) return;
if ((event->pos() - m_DragStartPosition).manhattanLength()
const QList <QTreeWidgetItem *> list = selectedItems();
QStringList ids;
foreach(const QTreeWidgetItem *item, list) {
- const ProjectItem *clip = static_cast <const ProjectItem *> (item);
- if (!clip->isGroup()) ids.append(clip->clipId());
- else {
- const int children = item->childCount();
- for (int i = 0; i < children; i++) {
- ids.append(static_cast <ProjectItem *>(item->child(i))->clipId());
- }
- }
+ const ProjectItem *clip = static_cast <const ProjectItem *>(item);
+ if (!clip->isGroup()) ids.append(clip->clipId());
+ else {
+ const int children = item->childCount();
+ for (int i = 0; i < children; i++) {
+ ids.append(static_cast <ProjectItem *>(item->child(i))->clipId());
+ }
+ }
}
- if (ids.isEmpty()) return;
+ if (ids.isEmpty()) return;
QByteArray data;
data.append(ids.join(";").toUtf8()); //doc.toString().toUtf8());
mimeData->setData("kdenlive/producerslist", data);
// virtual
void ProjectListView::dragMoveEvent(QDragMoveEvent * event) {
- QTreeWidgetItem * item = itemAt(event->pos());
event->setDropAction(Qt::IgnoreAction);
- //if (item) {
event->setDropAction(Qt::MoveAction);
if (event->mimeData()->hasText()) {
event->acceptProposedAction();
}
- //}
+ // stop playing because we get a crash otherwise when fetching the thumbnails
+ emit pauseMonitor();
}
QStringList ProjectListView::mimeTypes() const {