Commit 5a2390a7 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: fix drive selection on Windows

And close #6536
parent 842d0af3
...@@ -372,6 +372,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -372,6 +372,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';
...@@ -387,11 +388,13 @@ void DiscOpenPanel::onFocus() ...@@ -387,11 +388,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