void fm_Import::ScanHD()
{
QFileInfoList list = QDir::drives(); //获取当前系统的盘符
QString path;
bool bUsb = false;
for(int i=0;i<list.count();i++){
path = list[i].filePath();
qDebug()<<path;
//windows API的头文件中,GetDriveType的参数是PCWCH或者LPCWCH类型,需要进行转换,
//查看typedef CONST WCHAR *LPCWCH, *PCWCH;
//typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
UINT ret = GetDriveType((WCHAR *) path.utf16());
qDebug()<<ret;
if(ret == DRIVE_REMOVABLE){
qDebug()<<"存在可移动盘:"<<path;
bUsb = true;
this->AddDisk(path);
}
}
}