Remove redundant _guiAppInstance

Signed-off-by: alex-z <blackslayer4@gmail.com>
This commit is contained in:
alex-z 2022-03-31 16:18:54 +03:00 committed by Matthieu Gallien (Rebase PR Action)
parent b34f639fff
commit 71b610eee3
2 changed files with 2 additions and 14 deletions

View file

@ -111,22 +111,12 @@ public:
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) {
const auto msg = static_cast<MSG *>(message);
if(msg->message == WM_SYSCOLORCHANGE || msg->message == WM_SETTINGCHANGE) {
if(!_guiAppInstance) {
const auto ptr = qobject_cast<QGuiApplication *>(QGuiApplication::instance());
if(ptr) {
_guiAppInstance.reset(ptr);
}
}
if(_guiAppInstance) {
emit _guiAppInstance->paletteChanged(_guiAppInstance->palette());
if (const auto ptr = qobject_cast<QGuiApplication *>(QGuiApplication::instance())) {
emit ptr->paletteChanged(ptr->palette());
}
}
return false;
}
private:
QScopedPointer<QGuiApplication> _guiAppInstance;
};
#endif

View file

@ -120,8 +120,6 @@ private:
QPointer<QQmlApplicationEngine> _trayEngine;
AccessManagerFactory _accessManagerFactory;
QScopedPointer<QGuiApplication> _guiAppInstance;
};
} // namespace OCC