X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fprojectlistview.cpp;h=b424ebef1de1f43fb72e41ca7887e77479620c53;hb=5fdf3dfaacd0d5144b1fc2c3949e2cb774e50d25;hp=ea22c3f29923fcb72aeb39882fb0593eb772e2b7;hpb=c7505af406d99d87baf1f0e7a04ac4ea6f220000;p=kdenlive diff --git a/src/projectlistview.cpp b/src/projectlistview.cpp index ea22c3f2..b424ebef 100644 --- a/src/projectlistview.cpp +++ b/src/projectlistview.cpp @@ -176,8 +176,12 @@ void ProjectListView::dropEvent(QDropEvent *event) { 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 (parent->takeChild(parent->indexOfChild(it))); + if (clone) { + addTopLevelItem(clone); + clone->clearProperty("groupname"); + clone->clearProperty("groupid"); + } } } } @@ -215,9 +219,16 @@ void ProjectListView::mouseMoveEvent(QMouseEvent *event) { const QList list = selectedItems(); QStringList ids; foreach(const QTreeWidgetItem *item, list) { - // TODO allow dragging of folders - ids.append(((ProjectItem *) item)->clipId()); + const ProjectItem *clip = static_cast (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 (item->child(i))->clipId()); + } + } } + if (ids.isEmpty()) return; QByteArray data; data.append(ids.join(";").toUtf8()); //doc.toString().toUtf8()); mimeData->setData("kdenlive/producerslist", data);