From 4987a519ca4c6d231c8d17d956cc541754c27330 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 15 Oct 2022 15:50:13 +0300 Subject: [PATCH] kutils: show error message if kcmshell4 is not found from KEMailDialog Signed-off-by: Ivailo Monev --- kutils/kemail/kemaildialog.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kutils/kemail/kemaildialog.cpp b/kutils/kemail/kemaildialog.cpp index 46799557..df14675c 100644 --- a/kutils/kemail/kemaildialog.cpp +++ b/kutils/kemail/kemaildialog.cpp @@ -18,6 +18,7 @@ #include "kemaildialog.h" #include "klocale.h" +#include "kstandarddirs.h" #include "kmessagebox.h" #include "kdebug.h" @@ -203,8 +204,13 @@ bool KEMailDialog::setAttach(const QStringList &attach) void KEMailDialog::_slotSettings() { + const QString kcmshell4exe = KStandardDirs::findExe(QString::fromLatin1("kcmshell4")); + if (kcmshell4exe.isEmpty()) { + KMessageBox::error(this, i18n("kcmshell4 not found")); + return; + } QProcess::startDetached( - QString::fromLatin1("kcmshell4"), + kcmshell4exe, QStringList() << QString::fromLatin1("useraccount") ); }