From ef7c7e9569b302003bc93075a61c18b5f57e0c90 Mon Sep 17 00:00:00 2001 From: Yoann Peronneau Date: Tue, 27 Mar 2007 18:48:09 +0000 Subject: [PATCH] * open file widget: do nothing if the user clicked on cancel --- modules/gui/qt4/components/preferences_widgets.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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() -- 2.39.2