]> git.sesse.net Git - kdenlive/blobdiff - src/projectlistview.cpp
Fixed some missing strings.
[kdenlive] / src / projectlistview.cpp
index ea22c3f29923fcb72aeb39882fb0593eb772e2b7..b424ebef1de1f43fb72e41ca7887e77479620c53 100644 (file)
@@ -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 <ProjectItem*>(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 <QTreeWidgetItem *> list = selectedItems();
             QStringList ids;
             foreach(const QTreeWidgetItem *item, list) {
-                // TODO allow dragging of folders
-                ids.append(((ProjectItem *) item)->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;
             QByteArray data;
             data.append(ids.join(";").toUtf8()); //doc.toString().toUtf8());
             mimeData->setData("kdenlive/producerslist", data);