[vlc-devel] commit: Don't crash if I click "cancel" in getOpenFileNames ( Geoffroy Couprie )

git version control git at videolan.org
Sat Dec 26 16:24:31 CET 2009


vlc | branch: master | Geoffroy Couprie <geal at videolan.org> | Fri Dec 25 16:20:42 2009 +0100| [b039abe935b5d91e186dae3bb64405cafa400460] | committer: Geoffroy Couprie 

Don't crash if I click "cancel" in getOpenFileNames

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b039abe935b5d91e186dae3bb64405cafa400460
---

 modules/gui/qt4/dialogs_provider.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 29177ce..b1d9e22 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -309,7 +309,10 @@ void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
         i = 0;
         foreach( const QString &file, files )
             p_arg->psz_results[i++] = strdup( qtu( toNativeSepNoSlash( file ) ) );
-        p_intf->p_sys->filepath = qfu( p_arg->psz_results[i] );
+        if(i == 0)
+            p_intf->p_sys->filepath = QString::fromAscii("");
+        else
+            p_intf->p_sys->filepath = qfu( p_arg->psz_results[i] );
     }
 
     /* Callback */




More information about the vlc-devel mailing list