Solid

dummyinhibition.cpp
1/*
2 SPDX-FileCopyrightText: 2014 Alejandro Fiestas Olivares <afiestas@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "dummyinhibition.h"
8
9using namespace Solid;
10
11DummyInhibition::DummyInhibition(QObject *parent)
12 : AbstractInhibition(parent)
13 , m_state(Inhibition::Started)
14{
15}
16
17DummyInhibition::~DummyInhibition()
18{
19 stop();
20}
21
22void DummyInhibition::start()
23{
24 if (m_state == Inhibition::Started) {
25 return;
26 }
27
28 m_state = Inhibition::Started;
29 Q_EMIT stateChanged(m_state);
30}
31
32void DummyInhibition::stop()
33{
34 if (m_state == Inhibition::Stopped) {
35 return;
36 }
37
38 m_state = Inhibition::Stopped;
39 Q_EMIT stateChanged(m_state);
40}
41
42Inhibition::State DummyInhibition::state() const
43{
44 return m_state;
45}
46
47#include "moc_dummyinhibition.cpp"
Represents an inhibition, allows to stop and start it.
Holds an inhibition.
Definition inhibition.h:27
The single responsibility of this class is to create arguments valid for logind Inhibit call.
Definition fakebattery.h:16
Q_EMITQ_EMIT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:12 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.