diff --git a/src/calendarview.cpp b/src/calendarview.cpp --- a/src/calendarview.cpp +++ b/src/calendarview.cpp @@ -87,9 +87,10 @@ #include #include +#include #include #include -#include +#include #include #include @@ -1756,7 +1757,10 @@ void CalendarView::openAddressbook() { - KRun::runCommand(QStringLiteral("kaddressbook"), topLevelWidget()); + KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(QStringLiteral("kaddressbook"), {}, this); + job->setDesktopName(QStringLiteral("org.kde.kaddressbook")); + job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this)); + job->start(); } bool CalendarView::isReadOnly() const diff --git a/src/kcmdesignerfields.cpp b/src/kcmdesignerfields.cpp --- a/src/kcmdesignerfields.cpp +++ b/src/kcmdesignerfields.cpp @@ -24,12 +24,12 @@ #include #include "korganizer_debug.h" +#include #include #include #include -#include +#include #include -#include #include #include #include @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -440,8 +441,6 @@ void KCMDesignerFields::startDesigner() { - QString cmdLine = QStringLiteral("designer"); - // check if path exists and create one if not. QString cepPath = localUiDir(); if (!QDir(cepPath).exists()) { @@ -451,16 +450,19 @@ // finally jump there QDir::setCurrent(QLatin1String(cepPath.toLocal8Bit())); + QStringList args; QTreeWidgetItem *item = nullptr; if (mPageView->selectedItems().size() == 1) { item = mPageView->selectedItems().first(); } if (item) { PageItem *pageItem = static_cast(item->parent() ? item->parent() : item); - cmdLine += QLatin1Char(' ') + KShell::quoteArg(pageItem->path()); + args.append(pageItem->path()); } - KRun::runCommand(cmdLine, topLevelWidget()); + KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(QStringLiteral("designer"), args, this); + job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this)); + job->start(); } void KCMDesignerFields::showWhatsThis(const QString &href)