[vlmc-devel] [PATCH 09/12] MainWindow: Don't use pointers to show QDialogs

Yikai Lu luyikei.qmltu at gmail.com
Wed Apr 6 09:58:22 CEST 2016


---
 src/Gui/MainWindow.cpp | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 75f02c3..8cc1981 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -601,19 +601,14 @@ MainWindow::checkVideoLength()
 bool
 MainWindow::renderVideo( const QString& outputFileName )
 {
-    WorkflowFileRendererDialog  *dialog = new WorkflowFileRendererDialog;
-    dialog->setModal( true );
-    dialog->setOutputFileName( outputFileName );
+    WorkflowFileRendererDialog  dialog;
+    dialog.setModal( true );
+    dialog.setOutputFileName( outputFileName );
 
     Core::instance()->workflowRenderer()->startRenderToFile( outputFileName );
 
-    if ( dialog->exec() == QDialog::Rejected )
-    {
-        delete dialog;
+    if ( dialog.exec() == QDialog::Rejected )
         return false;
-    }
-
-    delete dialog;
     return true;
 }
 
@@ -622,17 +617,11 @@ MainWindow::renderVideoSettings( bool shareOnInternet )
 {
     Core::instance()->workflowRenderer()->stop();
 
-    RendererSettings *settings = new RendererSettings( shareOnInternet );
+    RendererSettings settings( shareOnInternet );
 
-    if ( settings->exec() == QDialog::Rejected )
-    {
-        delete settings;
+    if ( settings.exec() == QDialog::Rejected )
         return false;
-    }
-
-    delete settings;
-
-    return renderVideo( settings->outputFileName() );
+    return renderVideo( settings.outputFileName() );
 }
 
 QDockWidget*
-- 
1.9.1



More information about the Vlmc-devel mailing list