X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Faddeffectcommand.cpp;h=1ee529744ea8011de31372ddc6a1a4396761baa4;hb=c0013463acd1fc3a6645631d5cf4e9a21ef9cfdf;hp=7d8d5057af28b5fc1a539c299ffad4470389d3f9;hpb=cd85961a9520f2f3c909e889dacd8de539468b89;p=kdenlive diff --git a/src/addeffectcommand.cpp b/src/addeffectcommand.cpp index 7d8d5057..1ee52974 100644 --- a/src/addeffectcommand.cpp +++ b/src/addeffectcommand.cpp @@ -23,7 +23,14 @@ #include -AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, GenTime pos, QDomElement effect, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_track(track), m_pos(pos), m_effect(effect), m_doIt(doIt) { +AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, GenTime pos, QDomElement effect, bool doIt, QUndoCommand * parent) : + QUndoCommand(parent), + m_view(view), + m_track(track), + m_effect(effect.cloneNode().toElement()), + m_pos(pos), + m_doIt(doIt) +{ QString effectName; QDomNode namenode = effect.elementsByTagName("name").item(0); if (!namenode.isNull()) effectName = i18n(namenode.toElement().text().toUtf8().data()); @@ -34,13 +41,15 @@ AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, GenTi // virtual -void AddEffectCommand::undo() { +void AddEffectCommand::undo() +{ kDebug() << "---- undoing action"; if (m_doIt) m_view->deleteEffect(m_track, m_pos, m_effect); else m_view->addEffect(m_track, m_pos, m_effect); } // virtual -void AddEffectCommand::redo() { +void AddEffectCommand::redo() +{ kDebug() << "---- redoing action"; if (m_doIt) m_view->addEffect(m_track, m_pos, m_effect); else m_view->deleteEffect(m_track, m_pos, m_effect);