]> git.sesse.net Git - kdenlive/blobdiff - src/addclipcommand.cpp
Implement clipmanager
[kdenlive] / src / addclipcommand.cpp
index 1e8b961e2436b57d98aa79c511dabcafbd2b4e53..1408a5b5f859509e15d5207551d618c7a5a0eabb 100644 (file)
@@ -21,8 +21,8 @@
 
 #include "addclipcommand.h"
 
-AddClipCommand::AddClipCommand(ProjectList *list, const QStringList &names, const QDomElement &xml, const int id, const KUrl &url, const QString &group, bool doIt)
-         : m_list(list), m_names(names), m_xml(xml), m_id(id), m_url(url), m_group(group), m_doIt(doIt) {
+AddClipCommand::AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const uint id, bool doIt)
+         : m_doc(doc), m_xml(xml), m_id(id), m_doIt(doIt) {
            if (doIt) setText(i18n("Add clip"));
            else setText(i18n("Delete clip"));
         }
@@ -31,18 +31,16 @@ AddClipCommand::AddClipCommand(ProjectList *list, const QStringList &names, cons
 // virtual 
 void AddClipCommand::undo()
 {
-  if (!m_list) kDebug()<<"----  ERROR, NO LIST FOR undoing action";
 kDebug()<<"----  undoing action";
-  if (m_doIt) m_list->deleteClip(m_id);
-  else m_list->addClip(m_names, m_xml, m_id, m_url, m_group);
+  if (m_doIt) m_doc->deleteClip(m_id);
+  else m_doc->addClip(m_xml, m_id);
 }
 // virtual 
 void AddClipCommand::redo()
 {
-  if (!m_list) kDebug()<<"----  ERROR, NO LIST FOR redoing action";
 kDebug()<<"----  redoing action";
-  if (m_doIt) m_list->addClip(m_names, m_xml, m_id, m_url, m_group);
-  else m_list->deleteClip(m_id);
+  if (m_doIt) m_doc->addClip(m_xml, m_id);
+  else m_doc->deleteClip(m_id);
 }
 
 #include "addclipcommand.moc"