diff --git a/kdecore/tests/kdebug_unittest.cpp b/kdecore/tests/kdebug_unittest.cpp index 54992cb7..bfb36817 100644 --- a/kdecore/tests/kdebug_unittest.cpp +++ b/kdecore/tests/kdebug_unittest.cpp @@ -23,8 +23,8 @@ #include #include #include -#include #include +#include #include "moc_kdebug_unittest.cpp" QTEST_KDEMAIN_CORE( KDebugTest ) @@ -262,15 +262,14 @@ void KDebugTest::testHasNullOutput() void KDebugTest::testNoMainComponentData() { // This test runs kdebug_qcoreapptest and checks its output - KProcess proc; - proc.setEnv("KDE_DEBUG_NOPROCESSINFO", "1"); - proc.setEnv("KDE_DEBUG_TIMESTAMP", "0"); - proc.setOutputChannelMode(KProcess::OnlyStderrChannel); + QProcess proc; + QProcessEnvironment procenv = QProcessEnvironment::systemEnvironment(); + procenv.insert("KDE_DEBUG_NOPROCESSINFO", "1"); + procenv.insert("KDE_DEBUG_TIMESTAMP", "0"); + proc.setProcessEnvironment(procenv); + proc.setProcessChannelMode(QProcess::OnlyStderrChannel); QVERIFY(QFile::exists(KDEBINDIR "/kdecore-kdebug_qcoreapptest")); - proc << KDEBINDIR "/kdecore-kdebug_qcoreapptest"; - // kDebug() << proc.args(); - const int ok = proc.execute(); - QVERIFY(ok == 0); + QVERIFY(proc.execute(KDEBINDIR "/kdecore-kdebug_qcoreapptest")); const QByteArray allOutput = proc.readAllStandardError(); const QList receivedLines = allOutput.split('\n'); //qDebug() << receivedLines; diff --git a/kdecore/tests/kmimetypetest.cpp b/kdecore/tests/kmimetypetest.cpp index 4e7ed98e..2477e7ce 100644 --- a/kdecore/tests/kmimetypetest.cpp +++ b/kdecore/tests/kmimetypetest.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -44,6 +43,7 @@ #include #include #include +#include void KMimeTypeTest::initTestCase() { @@ -155,11 +155,9 @@ void KMimeTypeTest::cleanupTestCase() QFile::remove(fakePlugin); QFile::remove(m_kdeApp); QFile::remove(m_nonKdeApp); - //QProcess::execute( KGlobal::dirs()->findExe(KBUILDSYCOCA_EXENAME) ); - KProcess proc; - proc << KStandardDirs::findExe(KBUILDSYCOCA_EXENAME); - proc.setOutputChannelMode(KProcess::MergedChannels); // silence kbuildsycoca output - proc.execute(); + QProcess proc; + proc.setOutputChannelMode(QProcess::MergedChannels); // silence kbuildsycoca output + proc.execute(KStandardDirs::findExe(KBUILDSYCOCA_EXENAME)); } static void checkIcon( const KUrl& url, const QString& expectedIcon ) diff --git a/kdecore/tests/kservicetest.cpp b/kdecore/tests/kservicetest.cpp index efbfe325..d89dd578 100644 --- a/kdecore/tests/kservicetest.cpp +++ b/kdecore/tests/kservicetest.cpp @@ -31,7 +31,6 @@ #include #include -#include #include #include #include @@ -129,11 +128,9 @@ void KServiceTest::cleanupTestCase() const QString fakeService = KStandardDirs::locateLocal("services", service); QFile::remove(fakeService); } - //QProcess::execute( KGlobal::dirs()->findExe(KBUILDSYCOCA_EXENAME) ); - KProcess proc; - proc << KStandardDirs::findExe(KBUILDSYCOCA_EXENAME); - proc.setOutputChannelMode(KProcess::MergedChannels); // silence kbuildsycoca output - proc.execute(); + QProcess proc; + proc.setOutputChannelMode(QProcess::MergedChannels); // silence kbuildsycoca output + proc.execute(KStandardDirs::findExe(KBUILDSYCOCA_EXENAME)); } void KServiceTest::testByName() diff --git a/kded/tests/kmimeassociationstest.cpp b/kded/tests/kmimeassociationstest.cpp index 342a8fdc..69fee42a 100644 --- a/kded/tests/kmimeassociationstest.cpp +++ b/kded/tests/kmimeassociationstest.cpp @@ -18,7 +18,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include #include @@ -432,12 +432,11 @@ private: // (The real KCM code simply does the refresh in a slot, asynchronously) QEventLoop loop; QObject::connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), &loop, SLOT(quit())); - KProcess proc; + QProcess proc; const QString kbuildsycoca = KStandardDirs::findExe(KBUILDSYCOCA_EXENAME); QVERIFY(!kbuildsycoca.isEmpty()); - proc << kbuildsycoca; - proc.setOutputChannelMode(KProcess::MergedChannels); // silence kbuildsycoca output - proc.execute(); + proc.setProcessChannelMode(QProcess::MergedChannels); // silence kbuildsycoca output + proc.execute(kbuildsycoca); loop.exec(); } diff --git a/kdeui/dialogs/kedittoolbar.cpp b/kdeui/dialogs/kedittoolbar.cpp index a959d9f1..b2ff6451 100644 --- a/kdeui/dialogs/kedittoolbar.cpp +++ b/kdeui/dialogs/kedittoolbar.cpp @@ -23,16 +23,17 @@ #include -#include #include #include -#include +#include +#include +#include #include #include #include #include #include -#include +#include #include #include @@ -46,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -486,7 +486,7 @@ public: QLabel * m_helpArea; KPushButton* m_changeIcon; KPushButton* m_changeIconText; - KProcess* m_kdialogProcess; + QProcess* m_kdialogProcess; bool m_isPart : 1; bool m_hasKDialog : 1; bool m_loadedOnce : 1; @@ -1522,19 +1522,18 @@ void KEditToolBarWidgetPrivate::slotChangeIcon() m_currentXmlData->dump(); Q_ASSERT( m_currentXmlData->type() != XmlData::Merged ); - m_kdialogProcess = new KProcess; + m_kdialogProcess = new QProcess(); QString kdialogExe = KStandardDirs::findExe(QLatin1String("kdialog")); - (*m_kdialogProcess) << kdialogExe; - (*m_kdialogProcess) << "--caption"; - (*m_kdialogProcess) << i18n( "Change Icon" ); - (*m_kdialogProcess) << "--embed"; - (*m_kdialogProcess) << QString::number( (quintptr)m_widget->window()->winId() ); - (*m_kdialogProcess) << "--geticon"; - (*m_kdialogProcess) << "Toolbar"; - (*m_kdialogProcess) << "Actions"; - m_kdialogProcess->setOutputChannelMode(KProcess::OnlyStdoutChannel); - m_kdialogProcess->setNextOpenMode( QIODevice::ReadOnly | QIODevice::Text ); - m_kdialogProcess->start(); + QStringList kdialogArgs; + kdialogArgs << "--caption"; + kdialogArgs << i18n( "Change Icon" ); + kdialogArgs << "--embed"; + kdialogArgs << QString::number( (quintptr)m_widget->window()->winId() ); + kdialogArgs << "--geticon"; + kdialogArgs << "Toolbar"; + kdialogArgs << "Actions"; + m_kdialogProcess->setReadChannel(QProcess::StandardOutput); + m_kdialogProcess->start(kdialogExe, kdialogArgs); if ( !m_kdialogProcess->waitForStarted() ) { kError(240) << "Can't run " << kdialogExe << endl; delete m_kdialogProcess; diff --git a/kdeui/tests/kglobalsettingstest.cpp b/kdeui/tests/kglobalsettingstest.cpp index ec9e2c1c..83ea9e81 100644 --- a/kdeui/tests/kglobalsettingstest.cpp +++ b/kdeui/tests/kglobalsettingstest.cpp @@ -25,7 +25,7 @@ QTEST_KDEMAIN( KGlobalSettingsTest, GUI ) #include #include -#include +#include #include #include @@ -36,7 +36,6 @@ QTEST_KDEMAIN( KGlobalSettingsTest, GUI ) * and we check that the corresponding signals are emitted, i.e. that our process * got the dbus signal. * - * As a nice side-effect we automatically test a bit of KProcess as well :) */ void KGlobalSettingsTest::initTestCase() @@ -62,13 +61,9 @@ void KGlobalSettingsTest::initTestCase() QSignalSpy appearance_spy( settings, SIGNAL(appearanceChanged()) ) static void callClient( const QString& opt, const char* signalToWaitFor ) { - KProcess proc; + QProcess proc; QVERIFY(QFile::exists("./kdeui-kglobalsettingsclient")); - proc << "./kdeui-kglobalsettingsclient"; - proc << opt; -// kDebug() << proc.args(); - int ok = proc.execute(); - QVERIFY(ok == 0); + QVERIFY(proc.execute("./kdeui-kglobalsettingsclient", QStringList(opt))); QVERIFY(QTest::kWaitForSignal(KGlobalSettings::self(), signalToWaitFor, 5000)); } diff --git a/kdeui/tests/kuniqueapptest.cpp b/kdeui/tests/kuniqueapptest.cpp index 17042a65..dc9e2ed6 100644 --- a/kdeui/tests/kuniqueapptest.cpp +++ b/kdeui/tests/kuniqueapptest.cpp @@ -24,10 +24,10 @@ #include #include #include -#include #include #include +#include class TestApp : public KUniqueApplication { @@ -40,11 +40,10 @@ public: private Q_SLOTS: void executeNewChild() { // Duplicated from kglobalsettingstest.cpp - make a shared helper method? - KProcess* proc = new KProcess(this); + QProcess* proc = new QProcess(this); const QString appName = "kdeui-kuniqueapptest"; Q_ASSERT(QFile::exists(appName)); - (*proc) << "./" + appName; - proc->start(); + proc->start("./" + appName); } private: int m_callCount; diff --git a/kinit/klauncher.h b/kinit/klauncher.h index 58be147a..f14d19a6 100644 --- a/kinit/klauncher.h +++ b/kinit/klauncher.h @@ -37,7 +37,6 @@ #include #include -#include #include #include diff --git a/kio/kfile/kfilemetadataprovider_p.h b/kio/kfile/kfilemetadataprovider_p.h index 2a1018ea..50522e12 100644 --- a/kio/kfile/kfilemetadataprovider_p.h +++ b/kio/kfile/kfilemetadataprovider_p.h @@ -29,7 +29,6 @@ #include class KFileItemList; -class KProcess; class KUrl; class QWidget; diff --git a/kio/kfile/kfilesharedialog.cpp b/kio/kfile/kfilesharedialog.cpp index 14cf22b5..eea785ec 100644 --- a/kio/kfile/kfilesharedialog.cpp +++ b/kio/kfile/kfilesharedialog.cpp @@ -18,26 +18,26 @@ */ #include "kfilesharedialog.h" -#include -#include #include +#include +#include #include #include #include +#include #include #include -#include #include #include #include -#include #include +#include class KFileSharePropsPlugin::Private { public: KVBox *m_vBox; - KProcess *m_configProc; + QProcess *m_configProc; bool m_bAllShared; bool m_bAllUnshared; QWidget *m_widget; @@ -198,9 +198,8 @@ void KFileSharePropsPlugin::slotConfigureFileSharing() { if (d->m_configProc) return; - d->m_configProc = new KProcess(this); - (*d->m_configProc) << KStandardDirs::findExe("kdesu") << "kcmshell4" << "fileshare"; - if (!d->m_configProc->startDetached()) + d->m_configProc = new QProcess(this); + if (!d->m_configProc->startDetached(KStandardDirs::findExe("kdesu"), QStringList() << "kcmshell4" << "fileshare")) { delete d->m_configProc; d->m_configProc = 0; diff --git a/kio/kio/kbuildsycocaprogressdialog.cpp b/kio/kio/kbuildsycocaprogressdialog.cpp index 949fe0fc..f0f263e0 100644 --- a/kio/kio/kbuildsycocaprogressdialog.cpp +++ b/kio/kio/kbuildsycocaprogressdialog.cpp @@ -17,10 +17,10 @@ */ #include "kbuildsycocaprogressdialog.h" #include -#include #include #include -#include +#include +#include class KBuildSycocaProgressDialogPrivate { @@ -51,9 +51,8 @@ void KBuildSycocaProgressDialog::rebuildKSycoca(QWidget *parent) } else { // kded not running, e.g. when using keditfiletype out of a KDE session QObject::connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), &dlg, SLOT(_k_slotFinished())); - KProcess* proc = new KProcess(&dlg); - (*proc) << KStandardDirs::findExe(KBUILDSYCOCA_EXENAME); - proc->start(); + QProcess* proc = new QProcess(&dlg); + proc->start(KStandardDirs::findExe(KBUILDSYCOCA_EXENAME)); } dlg.exec(); } diff --git a/kio/kio/ksambashare.cpp b/kio/kio/ksambashare.cpp index c776d1f7..47f5815f 100644 --- a/kio/kio/ksambashare.cpp +++ b/kio/kio/ksambashare.cpp @@ -29,11 +29,11 @@ #include #include #include +#include #include #include #include -#include #include #include @@ -110,11 +110,9 @@ void KSambaSharePrivate::setUserSharePath() int KSambaSharePrivate::runProcess(const QString &progName, const QStringList &args, QByteArray &stdOut, QByteArray &stdErr) { - KProcess process; - - process.setProgram(progName, args); - process.setOutputChannelMode(KProcess::SeparateChannels); - process.start(); + QProcess process; + process.setProcessChannelMode(QProcess::SeparateChannels); + process.start(progName, args); //TODO: make it async in future process.waitForFinished(); @@ -361,7 +359,7 @@ KSambaShareData::UserShareError KSambaSharePrivate::remove(const KSambaShareData args << QLatin1String("usershare") << QLatin1String("delete") << shareData.name(); - int result = KProcess::execute(QLatin1String("net"), args); + int result = QProcess::execute(QLatin1String("net"), args); return (result == 0) ? KSambaShareData::UserShareOk : KSambaShareData::UserShareSystemError; } diff --git a/kio/misc/kpac/discovery.cpp b/kio/misc/kpac/discovery.cpp index 405d50fd..40191083 100644 --- a/kio/misc/kpac/discovery.cpp +++ b/kio/misc/kpac/discovery.cpp @@ -46,25 +46,24 @@ #include #include +#include #include #include #include #include -#include #include "moc_discovery.cpp" namespace KPAC { Discovery::Discovery( QObject* parent ) : Downloader( parent ), - m_helper( new KProcess(this) ) + m_helper( new QProcess(this) ) { - m_helper->setOutputChannelMode(KProcess::SeparateChannels); + m_helper->setProcessChannelMode(QProcess::SeparateChannels); connect( m_helper, SIGNAL(readyReadStandardOutput()), SLOT(helperOutput()) ); connect( m_helper, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(failed()) ); - *m_helper << KStandardDirs::findExe("kpac_dhcp_helper"); - m_helper->start(); + m_helper->start(KStandardDirs::findExe("kpac_dhcp_helper")); if ( !m_helper->waitForStarted() ) QTimer::singleShot( 0, this, SLOT(failed()) ); } diff --git a/kio/misc/kpac/discovery.h b/kio/misc/kpac/discovery.h index 85b438ac..208c1bac 100644 --- a/kio/misc/kpac/discovery.h +++ b/kio/misc/kpac/discovery.h @@ -23,7 +23,7 @@ #include "downloader.h" -class KProcess; +class QProcess; namespace KPAC { @@ -43,7 +43,7 @@ namespace KPAC bool initDomainName(); bool checkDomain() const; - KProcess* m_helper; + QProcess* m_helper; QString m_domainName; }; } diff --git a/kio/tests/kdcopcheck.cpp b/kio/tests/kdcopcheck.cpp index a607fef4..586de0c2 100644 --- a/kio/tests/kdcopcheck.cpp +++ b/kio/tests/kdcopcheck.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include "kdcopcheck.h" @@ -34,9 +34,8 @@ void debug(const char *format, const char *txt) TestService::TestService(const QString &exec) { m_exec = exec; - proc << exec; - proc.start(); + proc.start(exec); connect(KApplication::dcopClient(), SIGNAL(applicationRegistered(QByteArray)), this, SLOT(newApp(QByteArray))); diff --git a/kio/tests/kdcopcheck.h b/kio/tests/kdcopcheck.h index 4f961bb7..ffe9c5c1 100644 --- a/kio/tests/kdcopcheck.h +++ b/kio/tests/kdcopcheck.h @@ -21,7 +21,7 @@ public Q_SLOTS: protected: int result; QString m_exec; - KProcess proc; + QProcess proc; }; #endif diff --git a/kunitconversion/currency.cpp b/kunitconversion/currency.cpp index d61f8de3..8f0088f9 100644 --- a/kunitconversion/currency.cpp +++ b/kunitconversion/currency.cpp @@ -25,10 +25,10 @@ #include #include #include +#include #include #include #include -#include #include #ifndef KUNITCONVERSION_NO_SOLID @@ -550,7 +550,7 @@ Value Currency::convert(const Value& value, UnitPtr to) */ kDebug() << "Removed previous cache:" << QFile::remove(m_cache); #ifndef KUNITCONVERSION_NO_KIO - if (KProcess::execute(QStringList() << "kioclient" << "copy" << "--noninteractive" << URL << m_cache) == 0) { + if (QProcess::execute(QStringList() << "kioclient" << "copy" << "--noninteractive" << URL << m_cache) == 0) { m_update = true; } #else diff --git a/security/crypto/crypto.cpp b/security/crypto/crypto.cpp index 616f68ae..b7e66bd1 100644 --- a/security/crypto/crypto.cpp +++ b/security/crypto/crypto.cpp @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include