X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcommands%2Faddtransitioncommand.cpp;h=ead49b62172c8174b4953b5ff79a383fdfb8383a;hb=5d4746e4c3e8665de83e6d281dcd08a46cd22c31;hp=c8acc6dc8aa30ae13a58752a3dfda588e47289f0;hpb=d428e8bbbc881f61872743893518f568401df958;p=kdenlive diff --git a/src/commands/addtransitioncommand.cpp b/src/commands/addtransitioncommand.cpp index c8acc6dc..ead49b62 100644 --- a/src/commands/addtransitioncommand.cpp +++ b/src/commands/addtransitioncommand.cpp @@ -19,9 +19,9 @@ #include "addtransitioncommand.h" #include "customtrackview.h" -#include +#include -AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, ItemInfo info, int transitiontrack, QDomElement params, bool remove, bool doIt, QUndoCommand * parent) : +AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, const ItemInfo &info, int transitiontrack, const QDomElement ¶ms, bool remove, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_info(info), @@ -30,27 +30,36 @@ AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, ItemInfo info, m_doIt(doIt), m_remove(remove) { - if (m_remove) setText(i18n("Delete transition from clip")); - else setText(i18n("Add transition to clip")); + if (m_remove) + setText(i18n("Delete transition from clip")); + else + setText(i18n("Add transition to clip")); + if (parent) { // command has a parent, so there are several operations ongoing, do not refresh monitor m_refresh = false; - } else m_refresh = true; + } else { + m_refresh = true; + } } // virtual void AddTransitionCommand::undo() { - if (m_remove) m_view->addTransition(m_info, m_track, m_params, m_refresh); - else m_view->deleteTransition(m_info, m_track, m_params, m_refresh); + if (m_remove) + m_view->addTransition(m_info, m_track, m_params, m_refresh); + else + m_view->deleteTransition(m_info, m_track, m_params, m_refresh); } // virtual void AddTransitionCommand::redo() { if (m_doIt) { - if (m_remove) m_view->deleteTransition(m_info, m_track, m_params, m_refresh); - else m_view->addTransition(m_info, m_track, m_params, m_refresh); + if (m_remove) + m_view->deleteTransition(m_info, m_track, m_params, m_refresh); + else + m_view->addTransition(m_info, m_track, m_params, m_refresh); } m_doIt = true; }