]> git.sesse.net Git - kdenlive/commitdiff
slotDeleteTrack: Use QPointer [krazy 16/37] by Mikko Rapeli
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 23 Jul 2012 07:02:53 +0000 (09:02 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 23 Jul 2012 07:02:53 +0000 (09:02 +0200)
src/customtrackview.cpp

index c73bb0746fdc9da520e9b8c4bd4c7857f43df5a5..6606b7d301f0a34c73dd02a5d6a372d3b2d56391 100644 (file)
@@ -5964,21 +5964,22 @@ void CustomTrackView::slotInsertTrack(int ix)
 void CustomTrackView::slotDeleteTrack(int ix)
 {
     if (m_document->tracksCount() < 2) return;
-    TrackDialog d(m_document, parentWidget());
-    d.comboTracks->setCurrentIndex(ix);
-    d.label->setText(i18n("Delete track"));
-    d.before_select->setHidden(true);
-    d.setWindowTitle(i18n("Delete Track"));
-    d.video_track->setHidden(true);
-    d.audio_track->setHidden(true);
-    if (d.exec() == QDialog::Accepted) {
-        ix = d.comboTracks->currentIndex();
+    QPointer<TrackDialog> d = new TrackDialog(m_document, parentWidget());
+    d->comboTracks->setCurrentIndex(ix);
+    d->label->setText(i18n("Delete track"));
+    d->before_select->setHidden(true);
+    d->setWindowTitle(i18n("Delete Track"));
+    d->video_track->setHidden(true);
+    d->audio_track->setHidden(true);
+    if (d->exec() == QDialog::Accepted) {
+        ix = d->comboTracks->currentIndex();
         TrackInfo info = m_document->trackInfoAt(m_document->tracksCount() - ix - 1);
         deleteTimelineTrack(ix, info);
         setDocumentModified();
         /*AddTrackCommand* command = new AddTrackCommand(this, ix, info, false);
         m_commandStack->push(command);*/
     }
+    delete d;
 }
 
 void CustomTrackView::slotConfigTracks(int ix)