From 6b65b66f8e614af767e5b5407bb2aa8d271a8a22 Mon Sep 17 00:00:00 2001 From: matzman666 Date: Sat, 7 Jan 2017 18:54:49 +0100 Subject: [PATCH] Fixes an application crash when Revive is not installed. --- src/overlaycontroller.cpp | 2 +- src/tabcontrollers/ReviveTabController.cpp | 4 ++-- src/tabcontrollers/ReviveTabController.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/overlaycontroller.cpp b/src/overlaycontroller.cpp index 59dd346..93e67df 100644 --- a/src/overlaycontroller.cpp +++ b/src/overlaycontroller.cpp @@ -112,7 +112,7 @@ void OverlayController::Init(QQmlEngine* qmlEngine) { audioTabController.initStage1(); statisticsTabController.initStage1(); settingsTabController.initStage1(); - reviveTabController.initStage1(); + reviveTabController.initStage1(settingsTabController.forceRevivePage()); utilitiesTabController.initStage1(); // Set qml context diff --git a/src/tabcontrollers/ReviveTabController.cpp b/src/tabcontrollers/ReviveTabController.cpp index 56a3ee6..2c529c1 100644 --- a/src/tabcontrollers/ReviveTabController.cpp +++ b/src/tabcontrollers/ReviveTabController.cpp @@ -24,9 +24,9 @@ namespace advsettings { const char* key_piGender = "Gender"; - void ReviveTabController::initStage1() { + void ReviveTabController::initStage1(bool forceRevivePage) { m_isOverlayInstalled = vr::VRApplications()->IsApplicationInstalled(appkey_overlay); - if (m_isOverlayInstalled || parent->settingsTabController.forceRevivePage()) { + if (m_isOverlayInstalled || forceRevivePage) { vr::EVRSettingsError vrSettingsError; float valuef = vr::VRSettings()->GetFloat(section_revive, key_pixelsPerDisplayPixel, &vrSettingsError); diff --git a/src/tabcontrollers/ReviveTabController.h b/src/tabcontrollers/ReviveTabController.h index 9ffbc29..667e31e 100644 --- a/src/tabcontrollers/ReviveTabController.h +++ b/src/tabcontrollers/ReviveTabController.h @@ -73,7 +73,7 @@ namespace advsettings { std::vector controllerProfiles; public: - void initStage1(); + void initStage1(bool forceRevivePage); void initStage2(OverlayController* parent, QQuickWindow* widget); void eventLoopTick();