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

Hugo Beauzée-Luyssen hugo at beauzee.fr
Sat Mar 5 23:52:47 CET 2016


On 03/05/2016 06:18 PM, Yikai Lu wrote:
> Some platforms allow a QFileDialog to choose an project that doesn't exist, which causes various bugs.
> ---
>  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 )
> 
Applied, thanks!

-- 
Hugo Beauzée-Luyssen
www.beauzee.fr


More information about the Vlmc-devel mailing list