Commit 094908f6 authored by Lukáš Tinkl's avatar Lukáš Tinkl

rename states() to supportedStates()

introduce 2 other states, Reboot and Poweroff
parent fc791894
......@@ -91,7 +91,7 @@ void solidPowerTest::testSupportedStates()
QCOMPARE(job->states(), Power::Brightness | Power::Sleep);
job = Power::states();
job = Power::supportedStates();
QVERIFY(job->exec());
QCOMPARE(job->states(), Power::Brightness | Power::Sleep);
......
......@@ -42,7 +42,7 @@ public:
};
/**
* Instance InhibitionJob
* Instantiate InhibitionJob
*
* When this job emits result(Solid::Job*) and in case no
* error has happened, an Inhibition object will be
......
......@@ -54,16 +54,16 @@ AcPluggedJob* Power::isAcPlugged(QObject* parent)
return new AcPluggedJob(parent);
}
InhibitionJob* Power::inhibit(Power::States inhibitions, const QString& description, QObject* parent)
InhibitionJob* Power::inhibit(Power::States states, const QString& description, QObject* parent)
{
InhibitionJob *job = new InhibitionJob(parent);
job->setInhibitions(inhibitions);
job->setInhibitions(states);
job->setDescription(description);
return job;
}
StatesJob* Power::states(QObject* parent)
StatesJob* Power::supportedStates(QObject* parent)
{
return new StatesJob(parent);
}
......
......@@ -49,7 +49,9 @@ public:
Hibernation = 1 << 1,
HybridSleep = 1 << 2,
Screen = 1 << 3,
Brightness = 1 << 4
Brightness = 1 << 4,
Reboot = 1 << 5,
Poweroff = 1 << 6
};
Q_DECLARE_FLAGS(States, State)
/**
......@@ -85,7 +87,7 @@ public:
* Query the supported states (like Sleep or Hibernation)
* @return a StatesJob
*/
static StatesJob* states(QObject *parent = 0);
static StatesJob* supportedStates(QObject *parent = 0);
/**
* Set the computer in a desired @p state (like Sleep or Hibernation)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment