Commit 87458c2a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make sure helper apps we start are in path

parent 8cc6819d
Pipeline #132233 passed with stage
in 1 minute and 44 seconds
......@@ -180,7 +180,14 @@ void KleoPageConfigDialog::slotHelpClicked()
docUrl = QUrl(QStringLiteral("help:/")).resolved(QUrl(docPath)); // same code as in KHelpClient::invokeHelp
#endif
if (docUrl.scheme() == QLatin1String("help") || docUrl.scheme() == QLatin1String("man") || docUrl.scheme() == QLatin1String("info")) {
QProcess::startDetached(QStringLiteral("khelpcenter"), QStringList() << docUrl.toString());
const QString exec =
QStandardPaths::findExecutable(QStringLiteral("khelpcenter"));
if (exec.isEmpty()) {
qCWarning(KLEOPATRA_LOG) << "Could not find khelpcenter in PATH.";
} else {
QProcess::startDetached(QStringLiteral("khelpcenter"),
QStringList() << docUrl.toString());
}
} else {
QDesktopServices::openUrl(docUrl);
}
......
......@@ -34,10 +34,11 @@
#include <gpg-error.h>
#include <gpgme++/global.h>
#include <QStandardPaths>
#include <algorithm>
#include <string>
#include <sstream>
#include <memory>
#include <sstream>
#include <string>
#include <type_traits>
using namespace KleopatraClientCopy;
......@@ -458,11 +459,17 @@ static QString uiserver_executable()
static QString start_uiserver()
{
if (!QProcess::startDetached(uiserver_executable(), QStringList() << QStringLiteral("--daemon"))) {
return i18n("Failed to start uiserver %1", uiserver_executable());
} else {
return QString();
}
const QString executable = uiserver_executable();
const QString exec = QStandardPaths::findExecutable(executable);
if (exec.isEmpty()) {
qCWarning(LIBKLEOPATRACLIENTCORE_LOG)
<< "Could not find " << executable << " in PATH.";
return i18n("Failed to start uiserver %1", executable);
} else {
QProcess::startDetached(executable, QStringList()
<< QStringLiteral("--daemon"));
}
return QString();
}
static assuan_error_t getinfo_pid_cb(void *opaque, const void *buffer, size_t length)
......
......@@ -217,10 +217,17 @@ public:
void gnupgLogViewer()
{
if (!QProcess::startDetached(QStringLiteral("kwatchgnupg"), QStringList()))
KMessageBox::error(q, i18n("Could not start the GnuPG Log Viewer (kwatchgnupg). "
"Please check your installation."),
i18n("Error Starting KWatchGnuPG"));
const QString exec =
QStandardPaths::findExecutable(QStringLiteral("kwatchgnupg"));
if (exec.isEmpty()) {
KMessageBox::error(
q,
i18n("Could not start the GnuPG Log Viewer (kwatchgnupg). "
"Please check your installation."),
i18n("Error Starting KWatchGnuPG"));
} else {
QProcess::startDetached(QStringLiteral("kwatchgnupg"), QStringList());
}
}
void forceUpdateCheck()
......
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