From: Yoann Peronneau Date: Tue, 27 Mar 2007 18:48:09 +0000 (+0000) Subject: * open file widget: do nothing if the user clicked on cancel X-Git-Tag: 0.9.0-test0~7979 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=ef7c7e9569b302003bc93075a61c18b5f57e0c90;p=vlc * open file widget: do nothing if the user clicked on cancel --- diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp index 15a092ebcd..7531c77fe5 100644 --- a/modules/gui/qt4/components/preferences_widgets.cpp +++ b/modules/gui/qt4/components/preferences_widgets.cpp @@ -243,7 +243,7 @@ FileConfigControl::FileConfigControl( vlc_object_t *_p_this, FileConfigControl::FileConfigControl( vlc_object_t *_p_this, module_config_t *_p_item, - QLabel *_label, QLineEdit *_text, + QLabel *_label, QLineEdit *_text, QPushButton *_button, bool pwd ): VStringConfigControl( _p_this, _p_item ) { @@ -258,8 +258,10 @@ FileConfigControl::FileConfigControl( vlc_object_t *_p_this, void FileConfigControl::updateField() { - text->setText( QFileDialog::getOpenFileName( NULL, - qtr( "Select File" ), qfu( p_this->p_libvlc->psz_homedir ) ) ); + QString file = QFileDialog::getOpenFileName( NULL, + qtr( "Select File" ), qfu( p_this->p_libvlc->psz_homedir ) ); + if( file.isNull() ) return; + text->setText( file ); } void FileConfigControl::finish()