]> git.sesse.net Git - vlc/commitdiff
* open file widget: do nothing if the user clicked on cancel
authorYoann Peronneau <yoann@videolan.org>
Tue, 27 Mar 2007 18:48:09 +0000 (18:48 +0000)
committerYoann Peronneau <yoann@videolan.org>
Tue, 27 Mar 2007 18:48:09 +0000 (18:48 +0000)
modules/gui/qt4/components/preferences_widgets.cpp

index 15a092ebcd7f30c9c45c24ed0928313bd42975d6..7531c77fe5864a9675ea22fd6d1e5005c4d0b7ca 100644 (file)
@@ -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()