X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Faddclipcommand.cpp;h=44df4d5b11c9f57ef593ceb3bc7ba7a919f3773a;hb=3f928c7073780439f63f1fb5378ae144c84e735b;hp=2121c3db58169731638ee792b25626670fa9fb9c;hpb=187158b0450f465536c15cc31499bcc277d2a451;p=kdenlive diff --git a/src/addclipcommand.cpp b/src/addclipcommand.cpp index 2121c3db..44df4d5b 100644 --- a/src/addclipcommand.cpp +++ b/src/addclipcommand.cpp @@ -17,30 +17,36 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ + #include "addclipcommand.h" +#include "kdenlivedoc.h" + +#include -AddClipCommand::AddClipCommand(ProjectList *list, const QStringList &names, const QDomElement &xml, const int id, const KUrl &url, bool doIt) - : m_list(list), m_names(names), m_xml(xml), m_id(id), m_url(url), m_doIt(doIt) { - if (doIt) setText(i18n("Add clip")); - else setText(i18n("Delete clip")); - } +AddClipCommand::AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const QString &id, bool doIt, QUndoCommand * parent) : + QUndoCommand(parent), + m_doc(doc), + m_xml(xml), + m_id(id), + m_doIt(doIt) +{ + if (doIt) setText(i18n("Add clip")); + else setText(i18n("Delete clip")); +} -// virtual +// 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); + kDebug() << "---- undoing action"; + if (m_doIt) m_doc->deleteClip(m_id); + else m_doc->addClip(m_xml, m_id); } -// virtual +// 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); - else m_list->deleteClip(m_id); + kDebug() << "---- redoing action"; + if (m_doIt) m_doc->addClip(m_xml, m_id); + else m_doc->deleteClip(m_id); } -#include "addclipcommand.moc"