From 7728744cdd1e8fe310a0762d117fc453a236ee6d Mon Sep 17 00:00:00 2001 From: Vasily Date: Sat, 20 Jul 2019 10:29:30 +0200 Subject: [PATCH] Remove widget pointer from StatisticsTabController The pointer is not needed and is an anti pattern. --- src/overlaycontroller.cpp | 2 +- src/tabcontrollers/StatisticsTabController.cpp | 4 +--- src/tabcontrollers/StatisticsTabController.h | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/overlaycontroller.cpp b/src/overlaycontroller.cpp index 13dd53d..a439d38 100644 --- a/src/overlaycontroller.cpp +++ b/src/overlaycontroller.cpp @@ -488,7 +488,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem, m_chaperoneTabController.initStage2( this ); m_fixFloorTabController.initStage2( this ); m_audioTabController.initStage2(); - m_statisticsTabController.initStage2( this, m_pWindow.get() ); + m_statisticsTabController.initStage2( this ); m_settingsTabController.initStage2( this, m_pWindow.get() ); m_reviveTabController.initStage2( this, m_pWindow.get() ); m_utilitiesTabController.initStage2( this, m_pWindow.get() ); diff --git a/src/tabcontrollers/StatisticsTabController.cpp b/src/tabcontrollers/StatisticsTabController.cpp index b5a5abd..1adcd16 100644 --- a/src/tabcontrollers/StatisticsTabController.cpp +++ b/src/tabcontrollers/StatisticsTabController.cpp @@ -7,11 +7,9 @@ namespace advsettings { void StatisticsTabController::initStage1() {} -void StatisticsTabController::initStage2( OverlayController* var_parent, - QQuickWindow* var_widget ) +void StatisticsTabController::initStage2( OverlayController* var_parent ) { this->parent = var_parent; - this->widget = var_widget; } void StatisticsTabController::eventLoopTick( diff --git a/src/tabcontrollers/StatisticsTabController.h b/src/tabcontrollers/StatisticsTabController.h index b2d9872..63bd532 100644 --- a/src/tabcontrollers/StatisticsTabController.h +++ b/src/tabcontrollers/StatisticsTabController.h @@ -26,7 +26,6 @@ class StatisticsTabController : public QObject private: OverlayController* parent; - QQuickWindow* widget; bool rotationResetFlag = false; float rotationOffset = 0.0f; @@ -53,7 +52,7 @@ private: public: void initStage1(); - void initStage2( OverlayController* parent, QQuickWindow* widget ); + void initStage2( OverlayController* parent ); void eventLoopTick( vr::TrackedDevicePose_t* devicePoses, float leftSpeed,