effects/slidingpopups: Avoid using QApplication

CCBUG: 450359
This commit is contained in:
Vlad Zahorodnii 2022-02-16 09:40:40 +02:00
parent 9d33190d0d
commit 7ba68fde8c

View file

@ -11,7 +11,7 @@
#include "slidingpopups.h"
#include "slidingpopupsconfig.h"
#include <QApplication>
#include <QGuiApplication>
#include <QFontMetrics>
#include <QTimer>
#include <QWindow>
@ -36,7 +36,7 @@ SlidingPopupsEffect::SlidingPopupsEffect()
KWaylandServer::Display *display = effects->waylandDisplay();
if (display) {
if (!s_slideManagerRemoveTimer) {
s_slideManagerRemoveTimer = new QTimer(qApp);
s_slideManagerRemoveTimer = new QTimer(QCoreApplication::instance());
s_slideManagerRemoveTimer->setSingleShot(true);
s_slideManagerRemoveTimer->callOnTimeout([]() {
s_slideManager->remove();
@ -49,7 +49,7 @@ SlidingPopupsEffect::SlidingPopupsEffect()
}
}
m_slideLength = QFontMetrics(qApp->font()).height() * 8;
m_slideLength = QFontMetrics(QGuiApplication::font()).height() * 8;
m_atom = effects->announceSupportProperty("_KDE_SLIDE", this);
connect(effects, &EffectsHandler::windowAdded, this, &SlidingPopupsEffect::slotWindowAdded);