#include <KLocale>
-AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, const QString &clipId, ItemInfo info, EffectsList effects, bool overwrite, bool push, bool doIt, bool doRemove, QUndoCommand * parent) :
+AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, const QDomElement &xml, const QString &clipId, const ItemInfo &info, const EffectsList &effects, bool overwrite, bool push, bool doIt, bool doRemove, QUndoCommand * parent) :
QUndoCommand(parent),
m_view(view),
m_clipInfo(info),
{
if (!m_remove) setText(i18n("Add timeline clip"));
else setText(i18n("Delete timeline clip"));
- if (parent) {
- // command has a parent, so there are several operations ongoing, do not refresh monitor
- m_refresh = false;
- } else m_refresh = true;
}
// virtual
void AddTimelineClipCommand::undo()
{
- if (!m_remove) m_view->deleteClip(m_clipInfo, m_refresh);
- else m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push, m_refresh);
+ if (!m_remove)
+ m_view->deleteClip(m_clipInfo);
+ else
+ m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push);
}
// virtual
void AddTimelineClipCommand::redo()
{
if (m_doIt) {
- if (!m_remove) m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push, m_refresh);
- else m_view->deleteClip(m_clipInfo, m_refresh);
+ if (!m_remove)
+ m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push);
+ else
+ m_view->deleteClip(m_clipInfo);
}
m_doIt = true;
}