Small optimization

This commit is contained in:
Romolo Manfredini
2015-05-03 21:17:03 +02:00
parent bd463e5422
commit fc409adeca
+5 -3
View File
@@ -362,13 +362,15 @@ bool writeEeprom(const QString &filename, ProgressWidget *progress)
} }
#if defined WIN32 || !defined __GNUC__ #if defined WIN32 || !defined __GNUC__
bool isRemovableMedia( QString vol ) bool isRemovableMedia(const QString &vol )
{ {
char szDosDeviceName[MAX_PATH]; char szDosDeviceName[MAX_PATH];
UINT DriveType = GetDriveType( vol.replace("/","\\").toLatin1() ); QString volume;
volume.append(vol);
UINT DriveType = GetDriveType( volume.replace("/","\\").toLatin1() );
if ( DriveType != DRIVE_REMOVABLE ) if ( DriveType != DRIVE_REMOVABLE )
return false; return false;
QueryDosDevice( vol.replace("/","").toLatin1(), szDosDeviceName, MAX_PATH ); QueryDosDevice( volume.replace("/","").toLatin1(), szDosDeviceName, MAX_PATH );
if ( strstr( szDosDeviceName,"\\Floppy") != NULL ) { // its a floppy if ( strstr( szDosDeviceName,"\\Floppy") != NULL ) { // its a floppy
return false; return false;
} }