[vlmc-devel] [PATCH] WelcomePage: Add QMessageBox noticing user when project file is not found

yikei lu luyikei.qmltu at gmail.com
Sun Mar 12 22:20:08 CET 2017


On Sun, Mar 12, 2017 at 4:12 PM, Hieu Pham <phamhuuquanghieu at gmail.com> wrote:
> ---
>  src/Gui/wizard/WelcomePage.cpp | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/src/Gui/wizard/WelcomePage.cpp b/src/Gui/wizard/WelcomePage.cpp
> index 0b95dc1..1830a24 100644
> --- a/src/Gui/wizard/WelcomePage.cpp
> +++ b/src/Gui/wizard/WelcomePage.cpp
> @@ -105,6 +105,19 @@ WelcomePage::validatePage()
>                                        tr( "You first need to select a project from "
>                                        "the list.\nThen click next to continue..." ) );
>              return false;
> +        }
> +        else
> +        {
> +            QFile* m_projectFile = new QFile( *m_projectPath );
> +            if ( !m_projectFile->open( QFile::ReadOnly ) )

Sorry, but I came up this after sending my review: If you only care
about existence of files, you should use "bool QFile::exists(const
QString & fileName)"

Also, m_projectFile won't be deleted so it will leak.


> +            {
> +                QMessageBox msgBox;
> +                msgBox.setText( QObject::tr( "Sorry, we couldn't find your file. Was it moved, renamed, or deleted?" ) );
> +                msgBox.setInformativeText( QObject::tr( m_projectPath->toUtf8() ) );
> +                msgBox.setDefaultButton( QMessageBox::Ok );
> +                msgBox.exec();
> +                return false;
> +            }
>          }
>          return true;
>      }
> --
> 2.9.3
>
> _______________________________________________
> Vlmc-devel mailing list
> Vlmc-devel at videolan.org
> https://mailman.videolan.org/listinfo/vlmc-devel


More information about the Vlmc-devel mailing list