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

yikei lu luyikei.qmltu at gmail.com
Mon Mar 13 02:55:14 CET 2017


Could you squash these two commits into one?

On Sun, Mar 12, 2017 at 8:53 PM, Hieu Pham <phamhuuquanghieu at gmail.com> wrote:
> Remove redundant use of variable and pointer
> ---
>  src/Gui/wizard/WelcomePage.cpp | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/src/Gui/wizard/WelcomePage.cpp b/src/Gui/wizard/WelcomePage.cpp
> index 1830a24..6d1414d 100644
> --- a/src/Gui/wizard/WelcomePage.cpp
> +++ b/src/Gui/wizard/WelcomePage.cpp
> @@ -106,18 +106,14 @@ WelcomePage::validatePage()
>                                        "the list.\nThen click next to continue..." ) );
>              return false;
>          }
> -        else
> +        else if ( QFile::exists( *m_projectPath ) == false )
>          {
> -            QFile* m_projectFile = new QFile( *m_projectPath );
> -            if ( !m_projectFile->open( QFile::ReadOnly ) )
> -            {
> -                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;
> -            }
> +            QMessageBox msgBox;
> +            msgBox.setText( "Sorry, we couldn't find your file. Was it moved, renamed, or deleted?" );
> +            msgBox.setInformativeText( 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