]> git.sesse.net Git - kdenlive/blobdiff - src/addmarkercommand.cpp
Fix audio thumbs not displayed on project opening and abortion if audio thumbs creation
[kdenlive] / src / addmarkercommand.cpp
index da747f14e2a052589e741541d0b6c6335984380b..bc6d73207d874b55f167ede86b9f01a4b3b1a52c 100644 (file)
  *   (at your option) any later version.                                   *
  *                                                                         *
  ***************************************************************************/
-#include <KLocale>
+
 
 #include "addmarkercommand.h"
 #include "customtrackview.h"
 
-AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const QString &id, const GenTime &pos, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_oldcomment(oldcomment), m_comment(comment), m_id(id), m_pos(pos), m_doIt(doIt) {
+#include <KLocale>
+
+AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const QString &id, const GenTime &pos, QUndoCommand * parent) :
+        QUndoCommand(parent),
+        m_view(view),
+        m_oldcomment(oldcomment),
+        m_comment(comment),
+        m_id(id),
+        m_pos(pos)
+{
     if (m_comment.isEmpty()) setText(i18n("Delete marker"));
     else if (m_oldcomment.isEmpty()) setText(i18n("Add marker"));
     else setText(i18n("Edit marker"));
@@ -27,14 +36,13 @@ AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const QString &oldcomm
 
 
 // virtual
-void AddMarkerCommand::undo() {
+void AddMarkerCommand::undo()
+{
     m_view->addMarker(m_id, m_pos, m_oldcomment);
 }
 // virtual
-void AddMarkerCommand::redo() {
-    if (m_doIt) {
-        m_view->addMarker(m_id, m_pos, m_comment);
-    }
-    m_doIt = true;
+void AddMarkerCommand::redo()
+{
+    m_view->addMarker(m_id, m_pos, m_comment);
 }