#include "addtransitioncommand.h"
#include "customtrackview.h"
-#include <KLocale>
+#include <KLocalizedString>
-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),
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;
}