[vlmc-devel] [PATCH 2/3] MainWindow: Set a initial file path of saveAs

Yikai Lu luyikei.qmltu at gmail.com
Thu Jun 30 06:43:19 CEST 2016


---
 src/Gui/MainWindow.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index c77a2f1..7148bae 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -347,9 +347,13 @@ MainWindow::on_actionSave_triggered()
 void
 MainWindow::on_actionSave_As_triggered()
 {
-    //FIXME: This lacks the current project file path as a default location.
+    auto path = Core::instance()->recentProjects()->mostRecentProjectFile();
+
+    if ( path.isEmpty() == true )
+        path = VLMC_GET_STRING( "vlmc/WorkspaceLocation" );
+
     QString dest = QFileDialog::getSaveFileName( nullptr, QObject::tr( "Enter the output file name" ),
-                                  QString(), QObject::tr( "VLMC project file(*.vlmc)" ) );
+                                  path, QObject::tr( "VLMC project file(*.vlmc)" ) );
     if ( dest.isEmpty() == true )
         return;
     if ( !dest.endsWith( ".vlmc" ) ) 
-- 
1.9.1



More information about the Vlmc-devel mailing list