Commit aa1ea082 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: fix drive selection on Windows

And close #6536
(cherry picked from commit 5a2390a7)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent d4d31694
...@@ -373,6 +373,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -373,6 +373,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
void DiscOpenPanel::onFocus() void DiscOpenPanel::onFocus()
{ {
ui.deviceCombo->clear();
#ifdef WIN32 /* Disc drives probing for Windows */ #ifdef WIN32 /* Disc drives probing for Windows */
wchar_t szDrives[512]; wchar_t szDrives[512];
szDrives[0] = '\0'; szDrives[0] = '\0';
...@@ -388,11 +389,13 @@ void DiscOpenPanel::onFocus() ...@@ -388,11 +389,13 @@ void DiscOpenPanel::onFocus()
GetVolumeInformationW( drive, psz_name, 511, NULL, NULL, NULL, NULL, 0 ); GetVolumeInformationW( drive, psz_name, 511, NULL, NULL, NULL, NULL, 0 );
QString displayName = FromWide( drive ); QString displayName = FromWide( drive );
if( !*psz_name ) { char *psz_title = FromWide( psz_name );
displayName = displayName + " - " + FromWide( psz_name ); if( !EMPTY_STR(psz_title)) {
displayName = displayName + " - " + psz_title;
} }
ui.deviceCombo->addItem( displayName, FromWide( drive ) ); ui.deviceCombo->addItem( displayName, FromWide( drive ) );
free( psz_title );
} }
/* go to next drive */ /* go to next drive */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment