[vlc-commits] Qt: fix drive selection on Windows

Jean-Baptiste Kempf git at videolan.org
Sat Mar 31 23:22:31 CEST 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Mar 31 22:20:58 2012 +0200| [5a2390a78863423a6b5108debd1c6939ac5ab38a] | committer: Jean-Baptiste Kempf

Qt: fix drive selection on Windows

And close #6536

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

 modules/gui/qt4/components/open_panels.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index 91c4bd9..7f8e636 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -372,6 +372,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
 void DiscOpenPanel::onFocus()
 {
+    ui.deviceCombo->clear();
 #ifdef WIN32 /* Disc drives probing for Windows */
     wchar_t szDrives[512];
     szDrives[0] = '\0';
@@ -387,11 +388,13 @@ void DiscOpenPanel::onFocus()
                 GetVolumeInformationW( drive, psz_name, 511, NULL, NULL, NULL, NULL, 0 );
 
                 QString displayName = FromWide( drive );
-                if( !*psz_name ) {
-                    displayName = displayName + " - "  + FromWide( psz_name );
+                char *psz_title = FromWide( psz_name );
+                if( !EMPTY_STR(psz_title)) {
+                    displayName = displayName + " - "  + psz_title;
                 }
 
                 ui.deviceCombo->addItem( displayName, FromWide( drive ) );
+                free( psz_title );
             }
 
             /* go to next drive */



More information about the vlc-commits mailing list