Commit 737ac98f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make sure helper apps we start are in path

parent 13da17f5
Pipeline #132236 passed with stage
in 10 minutes and 9 seconds
......@@ -54,7 +54,11 @@ bool ApplicationGnuPGWKSUrlHandler::handleClick(MessageViewer::Viewer *viewerIns
const QUrlQuery q(path.mid(sizeof("gnupgwks?") - 1));
if (q.queryItemValue(QStringLiteral("action")) == QLatin1String("show")) {
QProcess::startDetached(QStringLiteral("kleopatra"), {QStringLiteral("--query"), q.queryItemValue(QStringLiteral("fpr"))});
const QString progFullPath = QStandardPaths::findExecutable(QStringLiteral("kleopatra"));
if (progFullPath.isEmpty()
|| !QProcess::startDetached(QStringLiteral("kleopatra"), {QStringLiteral("--query"), q.queryItemValue(QStringLiteral("fpr"))})) {
return false;
}
return true;
} else if (q.queryItemValue(QStringLiteral("action")) == QLatin1String("confirm")) {
GnuPGWKSMessagePart mp(part);
......
......@@ -235,7 +235,9 @@ void ItineraryUrlHandler::addToCalendar(ItineraryMemento *memento) const
void ItineraryUrlHandler::openInApp(MimeTreeParser::Interface::BodyPart *part) const
{
const auto fileName = createItineraryFile(part);
QProcess::startDetached(m_appPath, {fileName});
if (m_appPath.isEmpty() || !QProcess::startDetached(m_appPath, {fileName})) {
qCWarning(ITINERARY_LOG) << "Could not find application in PATH." << m_appPath;
}
}
void ItineraryUrlHandler::openWithKDEConnect(MimeTreeParser::Interface::BodyPart *part, const QString &deviceId) const
......
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