From 66fd6e64706cef0b4940c8a3eb2fa1a0cec355e4 Mon Sep 17 00:00:00 2001 From: Vasily Date: Sat, 20 Jul 2019 10:31:28 +0200 Subject: [PATCH] Remove widget pointer from SettingsTabController The pointer is not needed and is an anti pattern. --- src/overlaycontroller.cpp | 2 +- src/tabcontrollers/SettingsTabController.cpp | 4 +--- src/tabcontrollers/SettingsTabController.h | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/overlaycontroller.cpp b/src/overlaycontroller.cpp index a439d38..7958e9c 100644 --- a/src/overlaycontroller.cpp +++ b/src/overlaycontroller.cpp @@ -489,7 +489,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem, m_fixFloorTabController.initStage2( this ); m_audioTabController.initStage2(); m_statisticsTabController.initStage2( this ); - m_settingsTabController.initStage2( this, m_pWindow.get() ); + m_settingsTabController.initStage2( this ); m_reviveTabController.initStage2( this, m_pWindow.get() ); m_utilitiesTabController.initStage2( this, m_pWindow.get() ); m_videoTabController.initStage2( this, m_pWindow.get() ); diff --git a/src/tabcontrollers/SettingsTabController.cpp b/src/tabcontrollers/SettingsTabController.cpp index fd5ee01..cd516db 100644 --- a/src/tabcontrollers/SettingsTabController.cpp +++ b/src/tabcontrollers/SettingsTabController.cpp @@ -19,11 +19,9 @@ void SettingsTabController::initStage1() } } -void SettingsTabController::initStage2( OverlayController* var_parent, - QQuickWindow* var_widget ) +void SettingsTabController::initStage2( OverlayController* var_parent ) { this->parent = var_parent; - this->widget = var_widget; } void SettingsTabController::eventLoopTick() diff --git a/src/tabcontrollers/SettingsTabController.h b/src/tabcontrollers/SettingsTabController.h index a67fc7d..1b3cc4d 100644 --- a/src/tabcontrollers/SettingsTabController.h +++ b/src/tabcontrollers/SettingsTabController.h @@ -20,7 +20,6 @@ class SettingsTabController : public QObject private: OverlayController* parent; - QQuickWindow* widget; unsigned settingsUpdateCounter = 0; @@ -29,7 +28,7 @@ private: public: void initStage1(); - void initStage2( OverlayController* parent, QQuickWindow* widget ); + void initStage2( OverlayController* parent ); void eventLoopTick();