[vlmc-devel] MainWindow: Set a initial file path of saveAs

Yikai Lu git at videolan.org
Thu Jun 30 14:23:04 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Thu Jun 30 13:41:03 2016 +0900| [045de17b4723eec024892f5afd358bc08193170e] | committer: Yikai Lu

MainWindow: Set a initial file path of saveAs

> https://code.videolan.org/videolan/vlmc/commit/045de17b4723eec024892f5afd358bc08193170e
---

 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" ) ) 



More information about the Vlmc-devel mailing list