X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Feditguidecommand.cpp;h=20933a3c8e760fe06e0b7b04b4e8cdd7cd765ae5;hb=181eec2ee0701990a98d4a058224abb3a208ac3c;hp=10b2b78e02396bec70af86f3bd84d28461589294;hpb=a04d51e10a7b1fcfde9407fbab1feb1be6b568e7;p=kdenlive diff --git a/src/editguidecommand.cpp b/src/editguidecommand.cpp index 10b2b78e..20933a3c 100644 --- a/src/editguidecommand.cpp +++ b/src/editguidecommand.cpp @@ -14,12 +14,22 @@ * (at your option) any later version. * * * ***************************************************************************/ -#include + #include "editguidecommand.h" #include "customtrackview.h" -EditGuideCommand::EditGuideCommand(CustomTrackView *view, const GenTime oldPos, const QString &oldcomment, const GenTime pos, const QString &comment, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_oldPos(oldPos), m_oldcomment(oldcomment), m_pos(pos), m_comment(comment), m_doIt(doIt) { +#include + +EditGuideCommand::EditGuideCommand(CustomTrackView *view, const GenTime oldPos, const QString &oldcomment, const GenTime pos, const QString &comment, bool doIt, QUndoCommand * parent) : + QUndoCommand(parent), + m_view(view), + m_oldcomment(oldcomment), + m_comment(comment), + m_oldPos(oldPos), + m_pos(pos), + m_doIt(doIt) +{ if (m_oldcomment.isEmpty()) setText(i18n("Add guide")); else if (m_oldPos == m_pos) setText(i18n("Edit guide")); else if (m_pos <= GenTime()) setText(i18n("Delete guide")); @@ -28,15 +38,16 @@ EditGuideCommand::EditGuideCommand(CustomTrackView *view, const GenTime oldPos, // virtual -void EditGuideCommand::undo() { +void EditGuideCommand::undo() +{ m_view->editGuide(m_pos, m_oldPos, m_oldcomment); } // virtual -void EditGuideCommand::redo() { +void EditGuideCommand::redo() +{ if (m_doIt) { m_view->editGuide(m_oldPos, m_pos, m_comment); } m_doIt = true; } -#include "editguidecommand.moc"