X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcommands%2Fmoveeffectcommand.cpp;h=a96fcc4016e1f42d40796c505b5b59f36863309f;hb=29ceabd2afc227e0fb8b586c567eeaf7921b542e;hp=ba87dc3ddcb54ef9a25066f49376606a0f6de10d;hpb=020035a721ab682e4171443afaf10b5efa189586;p=kdenlive diff --git a/src/commands/moveeffectcommand.cpp b/src/commands/moveeffectcommand.cpp index ba87dc3d..a96fcc40 100644 --- a/src/commands/moveeffectcommand.cpp +++ b/src/commands/moveeffectcommand.cpp @@ -21,16 +21,19 @@ #include "moveeffectcommand.h" #include "customtrackview.h" -#include +#include +#include -MoveEffectCommand::MoveEffectCommand(CustomTrackView *view, const int track, GenTime pos, int oldPos, int newPos, QUndoCommand * parent) : - QUndoCommand(parent), - m_view(view), - m_track(track), - m_oldindex(oldPos), - m_newindex(newPos), - m_pos(pos) +MoveEffectCommand::MoveEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QList &oldPos, int newPos, QUndoCommand * parent) : + QUndoCommand(parent), + m_view(view), + m_track(track), + m_oldindex(oldPos), + m_pos(pos) { + for (int i = 0; i < m_oldindex.count(); ++i) { + m_newindex << newPos + i; + } /* QString effectName; QDomElement namenode = effect.firstChildElement("name"); if (!namenode.isNull()) effectName = i18n(namenode.text().toUtf8().data()); @@ -48,12 +51,16 @@ int MoveEffectCommand::id() const // virtual bool MoveEffectCommand::mergeWith(const QUndoCommand * other) { + Q_UNUSED(other) + return false; + /* dead code (flaged by coverity), was removed to avoid crash when dropping on group if (other->id() != id()) return false; if (m_track != static_cast(other)->m_track) return false; if (m_pos != static_cast(other)->m_pos) return false; m_oldindex = static_cast(other)->m_oldindex; m_newindex = static_cast(other)->m_newindex; return true; + */ } // virtual