Commit 6e277a43 authored by Andrea Scarpino's avatar Andrea Scarpino

Add missing namespace to Systemd::getUnitFileState

Fixes #15
parent b6f5019b
......@@ -167,7 +167,7 @@ Unit::Ptr SystemdPrivate::getUnitByPID(const uint pid)
return unit;
}
QString SystemdPrivate::getUnitFileState(const QString& file)
QString SystemdPrivate::getUnitFileState(const QString &file)
{
QDBusPendingReply<QString> reply = isdface.GetUnitFileState(file);
reply.waitForFinished();
......@@ -517,7 +517,7 @@ Unit::Ptr Systemd::getUnitByPID(const SessionType &session, const uint pid)
return globalSystemd(session)->getUnitByPID(pid);
}
QString getUnitFileState(const SessionType &session, const QString &file)
QString Systemd::getUnitFileState(const SessionType &session, const QString &file)
{
return globalSystemd(session)->getUnitFileState(file);
}
......
......@@ -60,6 +60,13 @@ public:
qDebug() << "Got unit, id:" << Systemd::getUnit(Systemd::System, unitName)->id();
}
static void getUnitFileState()
{
const QString unitName("lm_sensors.service");
qDebug() << "lm_sesnsors unit file state:" << Systemd::getUnitFileState(Systemd::System, unitName);
}
static void getUnitByPID()
{
qDebug() << Systemd::getUnitByPID(Systemd::System, 1)->id();
......@@ -141,6 +148,8 @@ int main(int argc, char* argv[])
SDManagerTest::getUnit();
SDManagerTest::getUnitFileState();
// SDManagerTest::getUnitByPID();
SDManagerTest::listJobs();
......
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