| 3393 | } |
| 3394 | |
| 3395 | QString WindowsSystem::GetSystemIconInfo(QString FileName) |
| 3396 | { |
| 3397 | if (FileName.isEmpty()) |
| 3398 | return QString(); |
| 3399 | |
| 3400 | QString thisFileName(FileName); |
| 3401 | SHFILEINFO FileInfo = {0}; |
| 3402 | int Indx = 0; |
| 3403 | bool Rtrn = false; |
| 3404 | |
| 3405 | if (GLOBAL(settings).enableHiResIcons && |
| 3406 | FileName.endsWith(".lnk", Qt::CaseInsensitive)) |
| 3407 | { |
| 3408 | // Resolve the LNK target |
| 3409 | fsManager->getShortcutTarget(thisFileName, &thisFileName); |
| 3410 | bool loadLinkIcon = false; |
| 3411 | QString fullPathExtension = fsManager->getFileExtension(thisFileName); |
| 3412 | // NOTE: we only get the full high-res icons if we pull the data from the exe |
| 3413 | // if (fullPathExtension != ".exe") |
| 3414 | loadLinkIcon = true; |
| 3415 | |
| 3416 | if (loadLinkIcon) |
| 3417 | { |
| 3418 | if (GLOBAL(settings).useThemeIconOverrides && |
| 3419 | (fsManager->getFileAttributes(thisFileName) & Directory) && |
| 3420 | !winOS->IsWindowsVersionGreaterThanOrEqualTo(WindowsVista)) |
| 3421 | { |
| 3422 | return "override.ext.folder"; |
| 3423 | } |
| 3424 | else if (fsManager->getFileAttributes(thisFileName)) |
| 3425 | { |
| 3426 | thisFileName = FileName; |
| 3427 | } |
| 3428 | } |
| 3429 | } |
| 3430 | |
| 3431 | // Get its Index |
| 3432 | SHGetFileInfo((LPCWSTR) thisFileName.utf16(), -1, &FileInfo, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX); |
| 3433 | Indx = FileInfo.iIcon; |
| 3434 | |
| 3435 | thisFileName = thisFileName.toLower(); |
| 3436 | |
| 3437 | // Cope over the path of the resource |
| 3438 | QString temp; |
| 3439 | if (thisFileName.contains("exe")) |
| 3440 | { |
| 3441 | temp.append(thisFileName); |
| 3442 | Indx = 0; |
| 3443 | }else{ |
| 3444 | temp.append("*"); |
| 3445 | } |
| 3446 | |
| 3447 | temp.append(ICON_PATH_CONCAT); |
| 3448 | temp.append(QString::number(Indx)); |
| 3449 | return temp; |
| 3450 | } |
| 3451 | |
| 3452 | QString WindowsSystem::GetFileTypeDescription(QString filename) |
no test coverage detected