[vlmc-devel] Ensure the WelcomePage to choose an existing project

Yikai Lu git at videolan.org
Sun Mar 6 00:12:39 CET 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Mar  6 02:18:52 2016 +0900| [3b01c72f52cac9f4eed07897b8a798411962aff9] | committer: Hugo Beauzée-Luyssen

Ensure the WelcomePage to choose an existing project

Some platforms allow a QFileDialog to choose an project that doesn't exist, which causes various bugs.

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> https://code.videolan.org/videolan/vlmc/commit/3b01c72f52cac9f4eed07897b8a798411962aff9
---

 src/Gui/wizard/WelcomePage.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/Gui/wizard/WelcomePage.cpp b/src/Gui/wizard/WelcomePage.cpp
index 096ec1d..046ec09 100644
--- a/src/Gui/wizard/WelcomePage.cpp
+++ b/src/Gui/wizard/WelcomePage.cpp
@@ -139,6 +139,13 @@ WelcomePage::loadProject()
 
     if ( projectPath.isEmpty() ) return;
 
+    if ( !QFile(projectPath).exists() )
+    {
+        QMessageBox::warning(this, tr("Invalid project file path"),
+                             tr("Please use an existing project file."));
+        return;
+    }
+
     // Search if the item is already in the list
     QListWidgetItem* item = NULL;
     for ( int i = 0; i < m_ui.projectsListWidget->count(); ++i )



More information about the Vlmc-devel mailing list