effects/contrast: Use QGuiApplication::instance() instead of qApp

qApp is defined differently depending on whether QCoreApplication,
QGuiApplication, or QApplication is included.

Use QGuiApplication::instance() to improve code readability.

CCBUG: 450359
This commit is contained in:
Vlad Zahorodnii 2022-02-16 10:21:06 +02:00
parent 9cca0a6f85
commit 1b4f3960fd

View file

@ -10,6 +10,7 @@
#include "contrastshader.h"
// KConfigSkeleton
#include <QCoreApplication>
#include <QMatrix4x4>
#include <QTimer>
#include <QWindow>
@ -38,7 +39,7 @@ ContrastEffect::ContrastEffect()
}
if (effects->waylandDisplay()) {
if (!s_contrastManagerRemoveTimer) {
s_contrastManagerRemoveTimer = new QTimer(qApp);
s_contrastManagerRemoveTimer = new QTimer(QCoreApplication::instance());
s_contrastManagerRemoveTimer->setSingleShot(true);
s_contrastManagerRemoveTimer->callOnTimeout([]() {
s_contrastManager->remove();