|
@@ -75,6 +75,9 @@ SystemdCommunicator::SystemdCommunicator(GUIBase *parent, const QString &service
|
|
this)),
|
|
this)),
|
|
m_serviceInterface(Q_NULLPTR)
|
|
m_serviceInterface(Q_NULLPTR)
|
|
{
|
|
{
|
|
|
|
+ if (!m_managerInterface)
|
|
|
|
+ emit error(i18n("Unable to init systemd dbus manager interface!"), true);
|
|
|
|
+
|
|
if (parent)
|
|
if (parent)
|
|
{
|
|
{
|
|
connect(this, &SystemdCommunicator::error, parent, &GUIBase::handleError);
|
|
connect(this, &SystemdCommunicator::error, parent, &GUIBase::handleError);
|
|
@@ -95,6 +98,12 @@ SystemdCommunicator::SystemdCommunicator(GUIBase *parent, const QString &service
|
|
emit serviceEnabledChanged();
|
|
emit serviceEnabledChanged();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+SystemdCommunicator::~SystemdCommunicator()
|
|
|
|
+{
|
|
|
|
+ delete m_managerInterface;
|
|
|
|
+ delete m_serviceInterface;
|
|
|
|
+}
|
|
|
|
+
|
|
void SystemdCommunicator::setServiceName(const QString &name)
|
|
void SystemdCommunicator::setServiceName(const QString &name)
|
|
{
|
|
{
|
|
if (name != m_serviceName)
|
|
if (name != m_serviceName)
|
|
@@ -132,6 +141,9 @@ void SystemdCommunicator::setServiceName(const QString &name)
|
|
QStringLiteral("org.freedesktop.systemd1.Unit"),
|
|
QStringLiteral("org.freedesktop.systemd1.Unit"),
|
|
QDBusConnection::systemBus(),
|
|
QDBusConnection::systemBus(),
|
|
this);
|
|
this);
|
|
|
|
+ if (!m_serviceInterface)
|
|
|
|
+ emit error(i18n("Unable to init systemd dbus service interface!"), true);
|
|
|
|
+
|
|
QDBusConnection::systemBus().connect(QStringLiteral("org.freedesktop.systemd1"),
|
|
QDBusConnection::systemBus().connect(QStringLiteral("org.freedesktop.systemd1"),
|
|
m_serviceObjectPath,
|
|
m_serviceObjectPath,
|
|
QStringLiteral("org.freedesktop.DBus.Properties"),
|
|
QStringLiteral("org.freedesktop.DBus.Properties"),
|