]> git.sesse.net Git - kdenlive/commitdiff
Fix timeline corruption when using Spacer tool + Ctrl on a track with a group
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 22 Sep 2009 18:06:32 +0000 (18:06 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 22 Sep 2009 18:06:32 +0000 (18:06 +0000)
svn path=/trunk/kdenlive/; revision=3924

src/customtrackview.cpp

index 170fe4eb16b945141fa5c8174e83079a2cff2f7e..50d6dbacb1ce2c7f20c0f04c45084683d428efb0 100644 (file)
@@ -759,6 +759,17 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
                 // Ctrl + click, select all items on track after click position
                 int track = (int)(mapToScene(m_clickEvent).y() / m_tracksHeight);
                 selection = items(m_clickEvent.x(), track * m_tracksHeight + m_tracksHeight / 2, mapFromScene(sceneRect().width(), 0).x() - m_clickEvent.x(), m_tracksHeight / 2 - 2);
+                int maxHeight = m_tracksHeight * 1.5;
+                for (int i = 0; i < selection.count(); i++) {
+                    // Check that we don't try to move a group with clips on other tracks
+                    if (selection.at(i)->type() == GROUPWIDGET && (selection.at(i)->boundingRect().height() >= maxHeight)) {
+                        emit displayMessage(i18n("Cannot use spacer in a track with a group"), ErrorMessage);
+                        return;
+                    } else if (selection.at(i)->parentItem() && (selection.at(i)->parentItem()->boundingRect().height() >= maxHeight)) {
+                        emit displayMessage(i18n("Cannot use spacer in a track with a group"), ErrorMessage);
+                        return;
+                    }
+                }
 
                 kDebug() << "SPACER TOOL + CTRL, SELECTING ALL CLIPS ON TRACK " << track << " WITH SELECTION RECT " << m_clickEvent.x() << "/" <<  track * m_tracksHeight + 1 << "; " << mapFromScene(sceneRect().width(), 0).x() - m_clickEvent.x() << "/" << m_tracksHeight - 2;
             } else {