- if (item->parent()) item = static_cast <ProjectItem *>(item->parent());
- if (item->isGroup()) {
- //emit addClip(event->mimeData->text());
- kDebug() << "//////////////// DROPPED RIGHT 1 ";
- const QList <QTreeWidgetItem *> list = selectedItems();
- ProjectItem *clone;
- QString parentId = item->clipId();
- foreach(QTreeWidgetItem *it, list) {
- // TODO allow dragging of folders ?
- if (!((ProjectItem *) it)->isGroup()/* && ((ProjectItem *) it)->clipId() < 10000*/) {
- if (it->parent()) clone = (ProjectItem*) it->parent()->takeChild(it->parent()->indexOfChild(it));
- else clone = (ProjectItem*) takeTopLevelItem(indexOfTopLevelItem(it));
- if (clone) {
- item->addChild(clone);
- QMap <QString, QString> props;
- props.insert("groupname", item->groupName());
- props.insert("groupid", parentId);
- clone->setProperties(props);
- }
+ //emit addClip(event->mimeData->text());
+ const QList <QTreeWidgetItem *> list = selectedItems();
+ ProjectItem *clone;
+ QString parentId = item->clipId();
+ foreach(QTreeWidgetItem *it, list) {
+ // TODO allow dragging of folders ?
+ if (it->type() == PROJECTCLIPTYPE) {
+ if (it->parent()) clone = (ProjectItem*) it->parent()->takeChild(it->parent()->indexOfChild(it));
+ else clone = (ProjectItem*) takeTopLevelItem(indexOfTopLevelItem(it));
+ if (clone) {
+ item->addChild(clone);
+ QMap <QString, QString> props;
+ props.insert("groupname", item->groupName());
+ props.insert("groupid", parentId);
+ clone->setProperties(props);