Commit 104f326a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make sure helper apps we start are in path

parent 49966b8d
Pipeline #132235 passed with stage
in 1 minute and 25 seconds
......@@ -14,6 +14,7 @@
#include <QDBusInterface>
#include <QDBusReply>
#include <QProcess>
#include <QStandardPaths>
#if !defined(Q_OS_WIN)
#include <unistd.h>
......@@ -66,7 +67,8 @@ bool QEkigaDialer::initializeEkiga()
// first check whether dbus interface is available yet
if (!isEkigaServiceRegistered()) {
// it could be ekiga is not running yet, so start it now
if (!QProcess::startDetached(QStringLiteral("ekiga"), QStringList())) {
const QString progFullPath = QStandardPaths::findExecutable(QStringLiteral("ekiga"));
if (progFullPath.isEmpty() || !QProcess::startDetached(QStringLiteral("ekiga"), QStringList())) {
mErrorMessage = i18n("Unable to start ekiga process, check that ekiga executable is in your PATH variable.");
return false;
}
......
......@@ -12,6 +12,7 @@
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QProcess>
#include <QStandardPaths>
#if !defined(Q_OS_WIN)
#include <unistd.h>
......@@ -47,7 +48,8 @@ bool QSflPhoneDialer::initializeSflPhone()
// first check whether dbus interface is available yet
if (!isSflPhoneServiceRegistered()) {
// it could be skype is not running yet, so start it now
if (!QProcess::startDetached(QStringLiteral("sflphone-client-kde"), QStringList())) {
const QString progFullPath = QStandardPaths::findExecutable(QStringLiteral("sflphone-client-kde"));
if (progFullPath.isEmpty() || !QProcess::startDetached(QStringLiteral("sflphone-client-kde"), QStringList())) {
mErrorMessage = i18n("Unable to start sflphone-client-kde process, check that sflphone-client-kde executable is in your PATH variable.");
return false;
}
......@@ -77,7 +79,8 @@ bool QSflPhoneDialer::dialNumber(const QString &number)
QStringList arguments;
arguments << QStringLiteral("--place-call");
arguments << number;
if (!QProcess::startDetached(QStringLiteral("sflphone-client-kde"), arguments)) {
const QString progFullPath = QStandardPaths::findExecutable(QStringLiteral("sflphone-client-kde"));
if (progFullPath.isEmpty() || !QProcess::startDetached(QStringLiteral("sflphone-client-kde"), arguments)) {
return false;
}
......@@ -95,7 +98,8 @@ bool QSflPhoneDialer::sendSms(const QString &number, const QString &text)
arguments << number;
arguments << QStringLiteral("--message");
arguments << text;
if (!QProcess::startDetached(QStringLiteral("sflphone-client-kde"), arguments)) {
const QString progFullPath = QStandardPaths::findExecutable(QStringLiteral("sflphone-client-kde"));
if (progFullPath.isEmpty() || !QProcess::startDetached(QStringLiteral("sflphone-client-kde"), arguments)) {
return false;
}
return true;
......
......@@ -16,6 +16,7 @@
#include <QProcess>
#if !defined(Q_OS_WIN)
#include <QStandardPaths>
#include <unistd.h>
#else
#include <windows.h>
......@@ -71,7 +72,8 @@ bool QSkypeDialer::initializeSkype()
// first check whether dbus interface is available yet
if (!isSkypeServiceRegistered()) {
// it could be skype is not running yet, so start it now
if (!QProcess::startDetached(QStringLiteral("skype"), QStringList())) {
const QString progFullPath = QStandardPaths::findExecutable(QStringLiteral("skype"));
if (progFullPath.isEmpty() || !QProcess::startDetached(QStringLiteral("skype"), QStringList())) {
mErrorMessage = i18n("Unable to start skype process, check that skype executable is in your PATH variable.");
return false;
}
......
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