]> git.sesse.net Git - kdenlive/blobdiff - src/commands/refreshmonitorcommand.cpp
Fix crash on project clip deletion
[kdenlive] / src / commands / refreshmonitorcommand.cpp
index 8130bbb3f28f6322b670f4fd05bf1f8215ab997e..384c79d694e4e14c717bb5ec8203cc153ccdbaa9 100644 (file)
 #include "customtrackview.h"
 
 
-RefreshMonitorCommand::RefreshMonitorCommand(CustomTrackView *view, bool execute, QUndoCommand * parent) :
+RefreshMonitorCommand::RefreshMonitorCommand(CustomTrackView *view, bool execute, bool refreshOnUndo, QUndoCommand * parent) :
         QUndoCommand(parent),
         m_view(view),
-        m_exec(execute)
+        m_exec(execute),
+        m_execOnUndo(refreshOnUndo)
 {
 }
 
@@ -33,12 +34,12 @@ RefreshMonitorCommand::RefreshMonitorCommand(CustomTrackView *view, bool execute
 // virtual
 void RefreshMonitorCommand::undo()
 {
-    m_view->monitorRefresh();
+    if (m_execOnUndo) m_view->monitorRefresh();
 }
 // virtual
 void RefreshMonitorCommand::redo()
 {
-    if (m_exec)
+    if (m_exec && !m_execOnUndo)
        m_view->monitorRefresh();
     m_exec = true;
 }