Logo Search packages:      
Sourcecode: kdenlive version File versions

void Gui::KdenliveApp::slot_moveClips ( QDropEvent *  event,
QListViewItem *  parent 
) [slot]

Move clips inside the project list view

Definition at line 3983 of file kdenlive.cpp.

References KdenliveDoc::clipHierarch(), ClipDrag::decode(), KdenliveDoc::findClipNode(), getDocument(), m_doc, and m_projectList.

Referenced by slot_insertClips().

                                                                               {
      DocClipRefList clips =
          ClipDrag::decode(getDocument(), event);

      clips.setAutoDelete(true);
      QPtrListIterator < DocClipRef > itt(clips);
      DocumentBaseNode *parentNode;
      // find folder on which the item was dropped
      if (parent) {
            //kdDebug()<<"+++++++ dropped on: "<<parent->text(1)<<endl;
            if (static_cast<AVListViewItem *>(parent)->clip() == 0) {
                  parentNode = getDocument()->findClipNode(parent->text(1));
            }
            else if (parent->parent() && (static_cast<AVListViewItem *>(parent->parent()))->clip() == 0) { 
                  parentNode = getDocument()->findClipNode(parent->parent()->text(1));
            }
            else parentNode = getDocument()->clipHierarch();
      }
      else parentNode = getDocument()->clipHierarch();

      // reparent the item
      while (itt.current()) {
          DocumentBaseNode *node = m_doc->findClipNode(itt.current()->name());
          if (node->hasParent() && node->parent()->name() != parentNode->name()) {
            DocumentBaseNode *oldParentNode = node->parent();
            oldParentNode->removeChild(node);
            node->reParent(parentNode);
            parentNode->addChild(node);
          }
        ++itt;
      }
      m_projectList->slot_UpdateList();
    }


Generated by  Doxygen 1.6.0   Back to index