| 2024 | } |
| 2025 | |
| 2026 | QDir WindowsSystem::GetDataDirectory() |
| 2027 | { |
| 2028 | if (scnManager->isInSandboxMode) |
| 2029 | { |
| 2030 | // path GLOBAL(dataPath); |
| 2031 | if (empty(GLOBAL(dataPath))) { |
| 2032 | QDir appPath = winOS->GetExecutableDirectory(); |
| 2033 | QString relDataName("SandboxData"); |
| 2034 | GLOBAL(dataPath) = appPath / relDataName; |
| 2035 | // check parent directory for data dir if not found |
| 2036 | if (!exists(make_file(appPath, relDataName))) { |
| 2037 | appPath = parent(appPath); |
| 2038 | if (exists(make_file(appPath, relDataName))) { |
| 2039 | GLOBAL(dataPath) = appPath / relDataName; |
| 2040 | } |
| 2041 | } |
| 2042 | } |
| 2043 | return GLOBAL(dataPath); |
| 2044 | } |
| 2045 | else if (scnManager->runBumpTopTestsOnStartup) |
| 2046 | { |
| 2047 | // path GLOBAL(dataPath); |
| 2048 | if (empty(GLOBAL(dataPath))) { |
| 2049 | QDir appPath = winOS->GetExecutableDirectory(); |
| 2050 | QString relDataName("UnitTestData"); |
| 2051 | GLOBAL(dataPath) = appPath / relDataName; |
| 2052 | // check parent directory for data dir if not found |
| 2053 | if (!exists(make_file(appPath, relDataName))) { |
| 2054 | appPath = parent(appPath); |
| 2055 | if (exists(make_file(appPath, relDataName))) { |
| 2056 | GLOBAL(dataPath) = appPath / relDataName; |
| 2057 | } |
| 2058 | } |
| 2059 | } |
| 2060 | return GLOBAL(dataPath); |
| 2061 | } |
| 2062 | else |
| 2063 | { |
| 2064 | // Data directory should be in the local Application Data folder |
| 2065 | // i.e. %AppData%/Bump Technologies, Inc/BumpTop |
| 2066 | if (empty(GLOBAL(dataPath))) |
| 2067 | GLOBAL(dataPath) = GetUserApplicationDataPath(); |
| 2068 | return GLOBAL(dataPath); |
| 2069 | } |
| 2070 | } |
| 2071 | |
| 2072 | QDir WindowsSystem::GetTrainingDirectory() |
| 2073 | { |