| 222 | } |
| 223 | |
| 224 | bool CReviveManifestController::Init() |
| 225 | { |
| 226 | bool bSuccess = LoadDocument(); |
| 227 | |
| 228 | if (!bSuccess) |
| 229 | { |
| 230 | QJsonArray applications; |
| 231 | m_manifest["applications"] = applications; |
| 232 | |
| 233 | bSuccess = SaveDocument(); |
| 234 | } |
| 235 | |
| 236 | #ifndef DEBUG |
| 237 | // Add application and support manifest |
| 238 | AddApplicationManifest(m_appFile); |
| 239 | AddApplicationManifest(m_supportFile); |
| 240 | #endif |
| 241 | |
| 242 | // Ensure the auto-launch flag is set |
| 243 | if (vr::VRApplications() && vr::VRApplications()->SetApplicationAutoLaunch(AppKey, true) != vr::VRApplicationError_None) |
| 244 | CTrayIconController::SharedInstance()->ShowInformation(TrayInfo_AutoLaunchFailed); |
| 245 | |
| 246 | // Get the base path |
| 247 | wchar_t path[MAX_PATH]; |
| 248 | if (GetOculusBasePath(path, MAX_PATH)) |
| 249 | { |
| 250 | QString base = QString::fromWCharArray(path); |
| 251 | if (!base.endsWith('\\')) |
| 252 | base.append('\\'); |
| 253 | qDebug("Oculus Base found: %s", qUtf8Printable(base)); |
| 254 | |
| 255 | m_strBaseURL = QUrl::fromLocalFile(base).url(); |
| 256 | m_strBasePath = QDir::fromNativeSeparators(base); |
| 257 | emit BaseChanged(); |
| 258 | } |
| 259 | |
| 260 | // Get the library path |
| 261 | QStringList path_array; |
| 262 | if (GetLibraries(m_lstLibraries, path_array)) |
| 263 | { |
| 264 | for (int i = 0; i < path_array.size(); ++i) { |
| 265 | QString library = path_array.at(i); |
| 266 | if (!library.endsWith('\\')) |
| 267 | library.append('\\'); |
| 268 | qDebug("Oculus Library found: %s", qUtf8Printable(library)); |
| 269 | |
| 270 | m_bLibraryFound = true; |
| 271 | m_strLibraryURL = QUrl::fromLocalFile(library).url(); |
| 272 | m_strLibraryPath = QDir::fromNativeSeparators(library); |
| 273 | m_lstLibrariesURL << m_strLibraryURL; |
| 274 | } |
| 275 | emit LibraryChanged(); |
| 276 | |
| 277 | if (vr::VRApplications() && !QCoreApplication::arguments().contains("-compositor")) |
| 278 | { |
| 279 | if (vr::VRApplications()->IsApplicationInstalled(AppKey) && vr::VRApplications()->GetApplicationAutoLaunch(AppKey)) |
| 280 | CTrayIconController::SharedInstance()->ShowInformation(TrayInfo_AutoLaunchEnabled); |
| 281 | } |
nothing calls this directly
no test coverage detected