From: Ivailo Monev Date: Thu, 20 Jul 2023 23:34:53 +0000 (+0300) Subject: kmix: replace KProcess with QProcess X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1636f17034b317bbb529ef6df756921a9259fd13;p=kde%2Fkde-extraapps.git kmix: replace KProcess with QProcess Signed-off-by: Ivailo Monev --- diff --git a/kmix/apps/kmix.cpp b/kmix/apps/kmix.cpp index 5e180fe8..47667688 100644 --- a/kmix/apps/kmix.cpp +++ b/kmix/apps/kmix.cpp @@ -29,6 +29,7 @@ #include #include #include +#include // include files for KDE #include @@ -48,7 +49,6 @@ #include #include #include -#include #include // KMix @@ -1270,27 +1270,11 @@ KMixWindow::slotHWInfo() void KMixWindow::slotKdeAudioSetupExec() { - QStringList args; - args << "kcmshell4" << "kcmplayer"; - forkExec(args); -} - -void -KMixWindow::forkExec(const QStringList& args) -{ - int pid = KProcess::startDetached(args); - if (pid == 0) - { - static const QString startErrorMessage( - i18n("The helper application is either not installed or not working.")); - QString msg; - msg += startErrorMessage; - msg += "\n("; - msg += args.join(QLatin1String(" ")); - msg += ')'; - errorPopup(msg); - } - + static const QString kcmshell4 = QString::fromLatin1("kcmshell4"); + static const QStringList kcmshell4args = QStringList() << QString::fromLatin1("kcmplayer"); + if (!QProcess::startDetached(kcmshell4, kcmshell4args)) { + errorPopup(i18n("The kcmshell4 application is either not installed or not working.")); + } } void diff --git a/kmix/apps/kmix.h b/kmix/apps/kmix.h index 940738ec..180ace66 100644 --- a/kmix/apps/kmix.h +++ b/kmix/apps/kmix.h @@ -92,7 +92,6 @@ public slots: private: KMixerWidget* findKMWforTab( const QString& tabId ); - void forkExec(const QStringList& args); void errorPopup(const QString& msg); KAction* _actionShowMenubar;