From: Jean-Baptiste Mardelle Date: Sat, 18 Oct 2008 22:58:34 +0000 (+0000) Subject: Be more careful when closing a document, may solve some of the crashes reported in... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6fa6d05a5df998ea48da101c5a437c21c45b0adc;p=kdenlive Be more careful when closing a document, may solve some of the crashes reported in issue: http://www.kdenlive.org:80/mantis/view.php?id=221 svn path=/branches/KDE4/; revision=2486 --- diff --git a/src/clipitem.cpp b/src/clipitem.cpp index bbf7540c..107e08bd 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -609,11 +609,9 @@ void ClipItem::paint(QPainter *painter, // draw transition handles on hover if (m_hover && itemWidth * scale > 40) { - QPainterPath transitionHandle; - const int handle_size = 4; QPointF p1 = painter->matrix().map(QPointF(0, itemHeight / 2)) + QPointF(10, 0); painter->drawPixmap(p1, projectScene()->m_transitionPixmap); - p1 = painter->matrix().map(QPointF(itemWidth, itemHeight / 2)) - QPointF(10 + handle_size * 3, 0); + p1 = painter->matrix().map(QPointF(itemWidth, itemHeight / 2)) - QPointF(22, 0); painter->drawPixmap(p1, projectScene()->m_transitionPixmap); } @@ -718,7 +716,6 @@ QList ClipItem::commentedSnapMarkers() const { } void ClipItem::slotPrepareAudioThumb(double pixelForOneFrame, int startpixel, int endpixel, int channels) { - QRectF re = sceneBoundingRect(); if (m_clipType == AV) re.setTop(re.y() + re.height() / 2); diff --git a/src/effectstackview.cpp b/src/effectstackview.cpp index b643085b..96378e89 100644 --- a/src/effectstackview.cpp +++ b/src/effectstackview.cpp @@ -264,6 +264,7 @@ void EffectStackView::clear() { ui.buttonReset->setEnabled(false); ui.buttonUp->setEnabled(false); ui.buttonDown->setEnabled(false); + effectedit->transferParamDesc(QDomElement(), 0, 0); } #include "effectstackview.moc" diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8dae2407..2231b2cc 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -895,7 +895,11 @@ void MainWindow::closeCurrentDocument() { if (m_timelineArea->count() == 1) m_timelineArea->setTabBarHidden(true); delete docToClose; delete w; - if (m_timelineArea->count() == 0) m_activeDocument = NULL; + if (m_timelineArea->count() == 0) { + m_activeDocument = NULL; + effectStack->clear(); + transitionConfig->slotTransitionItemSelected(NULL); + } } void MainWindow::saveFileAs(const QString &outputFileName) { diff --git a/src/projectlist.cpp b/src/projectlist.cpp index d8d30f91..a364ceb0 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -511,12 +511,12 @@ void ProjectList::slotAddTitleClip() { } void ProjectList::setDocument(KdenliveDoc *doc) { + listView->blockSignals(true); listView->clear(); m_thumbnailQueue.clear(); m_infoQueue.clear(); m_refreshed = false; QList list = doc->clipManager()->documentClipList(); - listView->blockSignals(true); for (int i = 0; i < list.count(); i++) { slotAddClip(list.at(i), false); }