Logo Search packages:      
Sourcecode: kdenlive version File versions

void Gui::KdenliveApp::slotProjectDeleteClips ( bool  confirm = true  )  [slot]

Remove clips from the project

Definition at line 3385 of file kdenlive.cpp.

References KdenliveDoc::activateSceneListGeneration(), addCommand(), Gui::TransitionDialog::belongsToClip(), Gui::MonitorManager::clearClip(), effectList(), KdenliveDoc::findClipNodeById(), getDocument(), m_doc, m_monitorManager, m_projectList, KdenliveDoc::referencedClips(), Gui::TransitionDialog::setTransition(), and slotStatusMsg().

Referenced by initActions().

      slotStatusMsg(i18n("Removing Clips"));
      DocClipRefList refClipList = m_projectList->currentSelection();
      if (refClipList.count() > 0) {
          if (confirm) {
            if (refClipList.count() > 1 || refClipList.first()->referencedClip()->numReferences() > 0)
                if (KMessageBox::warningContinueCancel(this, i18n("This will remove all clips on timeline that are currently using the selected clips. Are you sure you want to do this?")) != KMessageBox::Continue)
          DocClipRef *refClip;

          // Create a macro command that will delete all clips from the timeline involving this avfile. Then, delete it.
          KMacroCommand *macroCommand = new KMacroCommand(i18n("Delete Clip"));

          for (refClip = refClipList.first(); refClip; refClip = refClipList.next()) {
            DocClipBase *clip = refClip->referencedClip();

            // NOTE - we clear the monitors of the clip here - this does _not_ go into the macro command.
            int id = clip->getId();

            DocClipRefList list = m_doc->referencedClips(clip);
            QPtrListIterator < DocClipRef > itt(list);

            while (itt.current()) {
                Command::KAddRefClipCommand * command = new Command::KAddRefClipCommand(effectList(), *m_doc, itt.current(), false);
                if (m_transitionPanel->belongsToClip(itt.current())) m_transitionPanel->setTransition(0);

            // remove audio thumbnail and tmp files

            DocumentBaseNode *node = m_doc->findClipNodeById(id);
            if (!node) kdDebug()<<"++++++  CANNOT FIND NODE: "<<id<<endl;
            macroCommand->addCommand(new Command::KAddClipCommand(*m_doc, node->name(), clip, node->parent(), false));
          addCommand(macroCommand, true);
          if (confirm) getDocument()->activateSceneListGeneration(true);
      else if (confirm) slotProjectDeleteFolder();

Generated by  Doxygen 1.6.0   Back to index