Logo Search packages:      
Sourcecode: kdenlive version File versions

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

Given a drop event, inserts all contained clips into the project list, if they are not there already.

Definition at line 4017 of file kdenlive.cpp.

References addCommand(), ClipDrag::canDecode(), KdenliveDoc::clipHierarch(), ClipDrag::decode(), KdenliveDoc::findClipNode(), getDocument(), and slot_moveClips().

Referenced by initView().

                                                                                 {
      // sanity check.
      if (!ClipDrag::canDecode(event, true)) {
          slot_moveClips(event, parent);
          return;
      }
      DocClipRefList clips =
          ClipDrag::decode(getDocument(), event);

      clips.setAutoDelete(true);

      QPtrListIterator < DocClipRef > itt(clips);
      DocumentBaseNode *parentNode;
      if (parent) {
            if (parent->pixmap(0) == 0) parentNode = getDocument()->findClipNode(parent->text(1));
            else if (parent->parent() && parent->parent()->pixmap(0) == 0) 
                  parentNode = getDocument()->findClipNode(parent->parent()->text(1));
            else parentNode = getDocument()->clipHierarch();
      }
      else parentNode = getDocument()->clipHierarch();
      
      KMacroCommand *macroCommand = new KMacroCommand(i18n("Add Clips"));

      while (itt.current()) {
            Command::KAddClipCommand * command =
            new Command::KAddClipCommand(*getDocument(),
            "TBD - give proper name", itt.current()->referencedClip(),
            parentNode, true);
            //getDocument()->clipHierarch(), true);
            macroCommand->addCommand(command);
              ++itt;
      }

      addCommand(macroCommand, true);
    }


Generated by  Doxygen 1.6.0   Back to index