[vlmc-devel] [PATCH] Use simple if ()

Yikai Lu luyikei.qmltu at gmail.com
Tue Mar 29 15:52:38 CEST 2016


---
 src/Gui/MainWindow.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 786effd..190bdc0 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -341,10 +341,10 @@ MainWindow::initVlmcPreferences()
 void
 MainWindow::on_actionSave_triggered()
 {
-    if ( Core::getInstance()->project()->hasProjectFile() == false )
-        on_actionSave_As_triggered();
-    else
+    if ( Core::getInstance()->project()->hasProjectFile() )
         Core::getInstance()->project()->save();
+    else
+        on_actionSave_As_triggered();
 }
 
 void
@@ -353,7 +353,7 @@ MainWindow::on_actionSave_As_triggered()
     //FIXME: This lacks the current project file path as a default location.
     QString dest = QFileDialog::getSaveFileName( nullptr, QObject::tr( "Enter the output file name" ),
                                   QString(), QObject::tr( "VLMC project file(*.vlmc)" ) );
-    if ( dest.isEmpty() == true )
+    if ( dest.isEmpty() )
         return;
     if ( !dest.endsWith( ".vlmc" ) ) 
         dest += ".vlmc";
@@ -366,7 +366,7 @@ MainWindow::on_actionLoad_Project_triggered()
     QString folder = VLMC_GET_STRING( "vlmc/WorkspaceLocation" );
     QString fileName = QFileDialog::getOpenFileName( nullptr, tr( "Please choose a project file" ),
                                     folder, tr( "VLMC project file(*.vlmc)" ) );
-    if ( fileName.isEmpty() == true )
+    if ( fileName.isEmpty() )
         return ;
     Core::getInstance()->loadProject( fileName );
 }
-- 
1.9.1



More information about the Vlmc-devel mailing list