]> git.sesse.net Git - kdenlive/blobdiff - src/commands/editguidecommand.cpp
Use KLocalizedString (for i18n only, in kf5 it will necessary => use a script for...
[kdenlive] / src / commands / editguidecommand.cpp
index 20933a3c8e760fe06e0b7b04b4e8cdd7cd765ae5..0e80bce2f909c8df9228357ce20892566c328f74 100644 (file)
 #include "editguidecommand.h"
 #include "customtrackview.h"
 
-#include <KLocale>
-
-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)
+#include <KLocalizedString>
+
+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"));
-    else setText(i18n("Move guide"));
+    if (m_oldcomment.isEmpty()) {
+        setText(i18n("Add guide"));
+        m_oldPos = GenTime(-1);
+    }
+    else if (m_oldPos == m_pos)
+        setText(i18n("Edit guide"));
+    else if (m_pos < GenTime() && m_comment.isEmpty())
+        setText(i18n("Delete guide"));
+    else
+        setText(i18n("Move guide"));
 }
 
-
 // virtual
 void EditGuideCommand::undo()
 {