Commit eff05d49 authored by Àlex Fiestas's avatar Àlex Fiestas

Default to freedesktop instead of dummy

At some point we will need a proper backend loading system, atm this
works just fine.
parent 77c09363
......@@ -32,6 +32,7 @@ class solidPowerTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void testAcPluggedJob();
void testAcPluggedChanged();
void testAddInhibition();
......@@ -39,6 +40,11 @@ private Q_SLOTS:
void testRequestState();
};
void solidPowerTest::initTestCase()
{
qputenv("SOLID_POWER_BACKEND", "DUMMY");
}
void solidPowerTest::testAcPluggedJob()
{
AcPluggedJob *job = new AcPluggedJob();
......
......@@ -32,10 +32,10 @@ using namespace Solid;
AbstractAcPluggedJob* PowerBackendLoader::AcPluggedJob()
{
if (qgetenv("SOLID_POWER_BACKEND") == "FREE_DESKTOP") {
return new FDAcPluggedJob();
if (qgetenv("SOLID_POWER_BACKEND") == "DUMMY") {
return new DummyAcPluggedJob();
}
return new DummyAcPluggedJob();
return new FDAcPluggedJob();
}
AbstractInhibitionJob* PowerBackendLoader::addInhibitionJob(Power::States inhibitions, const QString &description)
......@@ -55,8 +55,8 @@ AbstractRequestStateJob* PowerBackendLoader::requestState()
PowerNotifier* PowerBackendLoader::notifier()
{
if (qgetenv("SOLID_POWER_BACKEND") == "FREE_DESKTOP") {
return new FDPowerNotifier();
if (qgetenv("SOLID_POWER_BACKEND") == "DUMMY") {
return new DummyPowerNotifier();
}
return new DummyPowerNotifier();
}
return new FDPowerNotifier();
}
\ No newline at end of file
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