From 71b610eee3693732e3aa6cb80268a25133bcf270 Mon Sep 17 00:00:00 2001 From: alex-z Date: Thu, 31 Mar 2022 16:18:54 +0300 Subject: [PATCH] Remove redundant _guiAppInstance Signed-off-by: alex-z --- src/gui/application.cpp | 14 ++------------ src/gui/systray.h | 2 -- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 5320ade69..9fbd620eb 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -111,22 +111,12 @@ public: bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) { const auto msg = static_cast(message); if(msg->message == WM_SYSCOLORCHANGE || msg->message == WM_SETTINGCHANGE) { - if(!_guiAppInstance) { - const auto ptr = qobject_cast(QGuiApplication::instance()); - if(ptr) { - _guiAppInstance.reset(ptr); - } - } - - if(_guiAppInstance) { - emit _guiAppInstance->paletteChanged(_guiAppInstance->palette()); + if (const auto ptr = qobject_cast(QGuiApplication::instance())) { + emit ptr->paletteChanged(ptr->palette()); } } return false; } - -private: - QScopedPointer _guiAppInstance; }; #endif diff --git a/src/gui/systray.h b/src/gui/systray.h index d5cdce358..0b4aabc3e 100644 --- a/src/gui/systray.h +++ b/src/gui/systray.h @@ -120,8 +120,6 @@ private: QPointer _trayEngine; AccessManagerFactory _accessManagerFactory; - - QScopedPointer _guiAppInstance; }; } // namespace OCC