plugins/idletime: Remove m_started boolean flag
This commit is contained in:
parent
a3de9bc93b
commit
7d692fd2a4
2 changed files with 0 additions and 11 deletions
|
@ -46,7 +46,6 @@ void KWinIdleTimePoller::unloadPoller()
|
||||||
qDeleteAll(m_timeouts);
|
qDeleteAll(m_timeouts);
|
||||||
m_timeouts.clear();
|
m_timeouts.clear();
|
||||||
|
|
||||||
m_started = false;
|
|
||||||
m_idling = false;
|
m_idling = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +66,6 @@ void KWinIdleTimePoller::addTimeout(int newTimeout)
|
||||||
m_timeouts.insert(newTimeout, timer);
|
m_timeouts.insert(newTimeout, timer);
|
||||||
|
|
||||||
if (!waylandServer()->idle()->isInhibited()) {
|
if (!waylandServer()->idle()->isInhibited()) {
|
||||||
m_started = true;
|
|
||||||
timer->start();
|
timer->start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,15 +84,9 @@ void KWinIdleTimePoller::onActivity()
|
||||||
|
|
||||||
void KWinIdleTimePoller::onInhibitedChanged()
|
void KWinIdleTimePoller::onInhibitedChanged()
|
||||||
{
|
{
|
||||||
if (!m_started) {
|
|
||||||
// if timers were not on, nothing to do
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (waylandServer()->idle()->isInhibited()) {
|
if (waylandServer()->idle()->isInhibited()) {
|
||||||
// must stop the timers
|
// must stop the timers
|
||||||
stopCatchingIdleEvents();
|
stopCatchingIdleEvents();
|
||||||
// keep started state from before inhibition
|
|
||||||
m_started = true;
|
|
||||||
} else {
|
} else {
|
||||||
// resume the timers
|
// resume the timers
|
||||||
catchIdleEvent();
|
catchIdleEvent();
|
||||||
|
@ -106,7 +98,6 @@ void KWinIdleTimePoller::onInhibitedChanged()
|
||||||
|
|
||||||
void KWinIdleTimePoller::catchIdleEvent()
|
void KWinIdleTimePoller::catchIdleEvent()
|
||||||
{
|
{
|
||||||
m_started = true;
|
|
||||||
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::timestampChanged, this, &KWinIdleTimePoller::onActivity);
|
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::timestampChanged, this, &KWinIdleTimePoller::onActivity);
|
||||||
|
|
||||||
for (QTimer *timer : qAsConst(m_timeouts)) {
|
for (QTimer *timer : qAsConst(m_timeouts)) {
|
||||||
|
@ -116,7 +107,6 @@ void KWinIdleTimePoller::catchIdleEvent()
|
||||||
|
|
||||||
void KWinIdleTimePoller::stopCatchingIdleEvents()
|
void KWinIdleTimePoller::stopCatchingIdleEvents()
|
||||||
{
|
{
|
||||||
m_started = false;
|
|
||||||
disconnect(waylandServer()->seat(), &KWaylandServer::SeatInterface::timestampChanged, this, &KWinIdleTimePoller::onActivity);
|
disconnect(waylandServer()->seat(), &KWaylandServer::SeatInterface::timestampChanged, this, &KWinIdleTimePoller::onActivity);
|
||||||
|
|
||||||
for (QTimer *timer : qAsConst(m_timeouts)) {
|
for (QTimer *timer : qAsConst(m_timeouts)) {
|
||||||
|
|
|
@ -46,7 +46,6 @@ private Q_SLOTS:
|
||||||
private:
|
private:
|
||||||
QHash<int, QTimer *> m_timeouts;
|
QHash<int, QTimer *> m_timeouts;
|
||||||
bool m_idling = false;
|
bool m_idling = false;
|
||||||
bool m_started = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue