Do not move further if system bus is not connected
Reviewers: stikonas, cjlcarvalho Reviewed By: stikonas Differential Revision: https://phabricator.kde.org/D21506
This commit is contained in:
parent
68cf1efd6b
commit
f481109417
|
@ -124,6 +124,11 @@ bool ExternalCommand::start(int timeout)
|
|||
if (command().isEmpty())
|
||||
return false;
|
||||
|
||||
if (!QDBusConnection::systemBus().isConnected()) {
|
||||
qWarning() << QDBusConnection::systemBus().lastError().message();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (report())
|
||||
report()->setCommand(xi18nc("@info:status", "Command: %1 %2", command(), args().join(QStringLiteral(" "))));
|
||||
|
||||
|
@ -134,11 +139,6 @@ bool ExternalCommand::start(int timeout)
|
|||
if (cmd.isEmpty())
|
||||
cmd = QStandardPaths::findExecutable(command(), { QStringLiteral("/sbin/"), QStringLiteral("/usr/sbin/"), QStringLiteral("/usr/local/sbin/") });
|
||||
|
||||
if (!QDBusConnection::systemBus().isConnected()) {
|
||||
qWarning() << QDBusConnection::systemBus().lastError().message();
|
||||
return false;
|
||||
}
|
||||
|
||||
auto *interface = new org::kde::kpmcore::externalcommand(QStringLiteral("org.kde.kpmcore.externalcommand"),
|
||||
QStringLiteral("/Helper"), QDBusConnection::systemBus(), this);
|
||||
|
||||
|
|
Loading…
Reference in New Issue