aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2015-06-03 21:34:28 +0200
committerJean-Baptiste Mardelle <[email protected]>2015-06-03 21:34:28 +0200
commit8b3895c919285a8030bfd1195fb4a63333f3a038 (patch)
tree8026a7ed035e730cdc3b04f6e0494a05de3cec38
parentd6a837966b86e6b12ce3062d62ce13d545d30741 (diff)
Fix crash when inserting invalid clip in timeline
-rw-r--r--src/monitor/monitor.cpp2
-rw-r--r--src/timeline/customtrackview.cpp22
2 files changed, 18 insertions, 6 deletions
diff --git a/src/monitor/monitor.cpp b/src/monitor/monitor.cpp
index e6727f5..5cb5027 100644
--- a/src/monitor/monitor.cpp
+++ b/src/monitor/monitor.cpp
@@ -1221,7 +1221,7 @@ void Monitor::slotEnableEffectScene(bool enable)
void Monitor::slotShowEffectScene(bool show, bool manuallyTriggered)
{
- if (show && !m_rootItem || m_rootItem->objectName() != "rooteffectscene") {
+ if (show && (!m_rootItem || m_rootItem->objectName() != "rooteffectscene")) {
m_glMonitor->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("kdenlivemonitoreffectscene.qml"))));
m_rootItem = m_glMonitor->rootObject();
QObject::connect(m_rootItem, SIGNAL(addKeyframe()), this, SIGNAL(addKeyframe()), Qt::UniqueConnection);
diff --git a/src/timeline/customtrackview.cpp b/src/timeline/customtrackview.cpp
index bb6d5ee..a9ac2dd 100644
--- a/src/timeline/customtrackview.cpp
+++ b/src/timeline/customtrackview.cpp
@@ -1833,7 +1833,10 @@ void CustomTrackView::dragEnterEvent(QDragEnterEvent * event)
event->setDropAction(Qt::MoveAction);
event->acceptProposedAction();
}
- } else QGraphicsView::dragEnterEvent(event);
+ }
+ else {
+ QGraphicsView::dragEnterEvent(event);
+ }
}
bool CustomTrackView::itemCollision(AbstractClipItem *item, const ItemInfo &newPos)
@@ -2717,7 +2720,8 @@ void CustomTrackView::dragMoveEvent(QDragMoveEvent * event)
insertDropClips(event->mimeData(), event->pos());
event->accept();
}
- } else {
+ }
+ else {
QGraphicsView::dragMoveEvent(event);
}
}
@@ -2736,7 +2740,10 @@ void CustomTrackView::dragLeaveEvent(QDragLeaveEvent * event)
m_selectionGroup = NULL;
m_dragItem = NULL;
event->accept();
- } else QGraphicsView::dragLeaveEvent(event);
+ }
+ else {
+ QGraphicsView::dragLeaveEvent(event);
+ }
}
void CustomTrackView::dropEvent(QDropEvent * event)
@@ -2799,7 +2806,9 @@ void CustomTrackView::dropEvent(QDropEvent * event)
}
// Add refresh command for redo
new RefreshMonitorCommand(this, false, false, addCommand);
-
+ for (int i = 0; i < brokenClips.count(); i++) {
+ items.removeAll(brokenClips.at(i));
+ }
qDeleteAll(brokenClips);
brokenClips.clear();
if (addCommand->childCount() > 0) m_commandStack->push(addCommand);
@@ -2841,7 +2850,10 @@ void CustomTrackView::dropEvent(QDropEvent * event)
/// \todo enable when really working
// alignAudio();
- } else QGraphicsView::dropEvent(event);
+ }
+ else {
+ QGraphicsView::dropEvent(event);
+ }
setFocus();
}