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

Fix AcPluggedTest by interpreting correctly the onBattery

onBattery == true, means we are NOT on AC.
parent 2df44141
......@@ -62,12 +62,12 @@ void solidFreedesktopTest::testAcPluggedJob()
m_fakeUPower->m_onBattery = true;
auto job = new AcPluggedJob(this);
QVERIFY(job->exec());
QCOMPARE(job->isPlugged(), m_fakeUPower->m_onBattery);
QCOMPARE(job->isPlugged(), false);
m_fakeUPower->m_onBattery = false;
job = Solid::Power::isAcPlugged();
QVERIFY(job->exec());
QCOMPARE(job->isPlugged(), m_fakeUPower->m_onBattery);
QCOMPARE(job->isPlugged(), true);
}
void solidFreedesktopTest::testAcPluggedChanged()
......
......@@ -57,7 +57,7 @@ void FDAcPluggedJob::slotDBusReply(const QDBusMessage& msg)
QDBusInterface inter("org.kde.kded5", "/org/kde/kded5");
Q_ASSERT(!msg.arguments().isEmpty());
m_isPlugged = msg.arguments().first().value<QDBusVariant>().variant().toBool();
m_isPlugged = !msg.arguments().first().value<QDBusVariant>().variant().toBool();
emitResult();
}
......
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