From: Jean-Baptiste Kempf Date: Sat, 31 Mar 2012 20:20:58 +0000 (+0200) Subject: Qt: fix drive selection on Windows X-Git-Tag: 2.1.0-git~4915 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=5a2390a78863423a6b5108debd1c6939ac5ab38a;p=vlc Qt: fix drive selection on Windows And close #6536 --- diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp index 91c4bd977d..7f8e6363cd 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 */