[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdenlive/Applications/16.12] src/timeline: Fix crash on razor with multiple clips selected
From:       Jean-Baptiste Mardelle <null () kde ! org>
Date:       2017-02-05 22:53:42
Message-ID: E1caVgk-0007RT-Gz () code ! kde ! org
[Download RAW message or body]

Git commit 6d71034c432bb009947f6fff5757564521aa66fe by Jean-Baptiste Mardelle.
Committed on 05/02/2017 at 22:53.
Pushed by mardelle into branch 'Applications/16.12'.

Fix crash on razor with multiple clips selected
BUG: 376082

M  +8    -2    src/timeline/customtrackview.cpp

https://commits.kde.org/kdenlive/6d71034c432bb009947f6fff5757564521aa66fe

diff --git a/src/timeline/customtrackview.cpp b/src/timeline/customtrackview.cpp
index 769ac0cc4..4cf868eaf 100644
--- a/src/timeline/customtrackview.cpp
+++ b/src/timeline/customtrackview.cpp
@@ -4315,6 +4315,8 @@ void CustomTrackView::cutSelectedClips(QList<QGraphicsItem *> \
itemList, GenTime  if (under)
             itemList << under;
     }
+    QUndoCommand *command = new QUndoCommand;
+    command->setText(i18n("Razor clip"));
     for (int i = 0; i < itemList.count(); ++i) {
         if (!itemList.at(i))
             continue;
@@ -4325,8 +4327,7 @@ void CustomTrackView::cutSelectedClips(QList<QGraphicsItem *> \
itemList, GenTime  if (!groups.contains(group))
                     groups << group;
             } else if (currentPos > item->startPos() && currentPos < item->endPos()) \
                {
-                RazorClipCommand *command = new RazorClipCommand(this, item->info(), \
                item->effectList(), currentPos);
-                m_commandStack->push(command);
+                new RazorClipCommand(this, item->info(), item->effectList(), \
currentPos, true, command);  }
         } else if (itemList.at(i)->type() == GroupWidget && itemList.at(i) != \
                m_selectionGroup) {
             AbstractGroupItem *group = static_cast<AbstractGroupItem \
*>(itemList.at(i)); @@ -4334,6 +4335,11 @@ void \
CustomTrackView::cutSelectedClips(QList<QGraphicsItem *> itemList, GenTime  groups << \
group;  }
     }
+    if (command->childCount() > 0) {
+        m_commandStack->push(command);
+    } else {
+        delete command;
+    }
 
     for (int i = 0; i < groups.count(); ++i)
         razorGroup(groups.at(i), currentPos);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic