MCPcopy Create free account
hub / github.com/bumptop/BumpTop / GetSystemPath

Method GetSystemPath

trunk/win/Source/BT_WindowsOS.cpp:3466–3508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3464}
3465
3466QString WindowsSystem::GetSystemPath(int SystemLocation)
3467{
3468 // return the cached value if possible
3469 if (_virtualIconTypePathMap.contains(SystemLocation))
3470 return _virtualIconTypePathMap[SystemLocation];
3471
3472 QString pathStr;
3473 TCHAR path[MAX_PATH];
3474
3475 if (SystemLocation == DesktopDirectory)
3476 {
3477 // special case for the sandbox mode
3478 if (scnManager->isInSandboxMode)
3479 pathStr = native(winOS->GetExecutableDirectory() / "SandboxDesktop");
3480
3481 // special case for unit testing mode
3482 else if (scnManager->runBumpTopTestsOnStartup)
3483 pathStr = native(winOS->GetExecutableDirectory() / "UnitTestDesktop");
3484
3485 if (!pathStr.isEmpty())
3486 {
3487 _virtualIconTypePathMap.insert(Desktop, pathStr);
3488 return pathStr;
3489 }
3490 }
3491
3492 LPITEMIDLIST itemIdList;
3493
3494 // Retrieve the Desktop path
3495 if (SUCCEEDED(SHGetSpecialFolderLocation(NULL, SystemLocation, &itemIdList)))
3496 {
3497 if (SUCCEEDED(SHGetPathFromIDList(itemIdList, path)))
3498 {
3499 // set the path string
3500 pathStr = QString::fromUtf16((const ushort *) path);
3501 LOG(QString_NT("special folder %1: %2").arg(SystemLocation).arg(pathStr));
3502 _virtualIconTypePathMap.insert(SystemLocation, pathStr);
3503 }
3504 CoTaskMemFree(itemIdList);
3505 }
3506
3507 return pathStr;
3508}
3509
3510QDir WindowsSystem::GetUserApplicationDataPath()
3511{

Callers 15

onDropMethod · 0.80
createDesktopLibraryMethod · 0.80
initMethod · 0.80
crossReferenceMethod · 0.80
InitMethod · 0.80
ParseCommandLineMethod · 0.80
OnTimerMethod · 0.80
GetIconPositionsMethod · 0.80

Calls 7

nativeFunction · 0.70
LOGFunction · 0.50
containsMethod · 0.45
isEmptyMethod · 0.45
insertMethod · 0.45
argMethod · 0.45

Tested by

no test coverage detected