From d1f768846d484ef1a1787e56c563985973ec4bdb Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 29 May 2013 16:51:45 +0200 Subject: add errorString to execute operation error output Change-Id: Ieb1db289f50188107204e0a1e42ccb51f512229e Reviewed-by: Karsten Heimrich --- src/libs/installer/elevatedexecuteoperation.cpp | 3 ++- src/libs/installer/fsengineserver.cpp | 2 ++ src/libs/installer/qprocesswrapper.cpp | 8 ++++++++ src/libs/installer/qprocesswrapper.h | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src/libs/installer') diff --git a/src/libs/installer/elevatedexecuteoperation.cpp b/src/libs/installer/elevatedexecuteoperation.cpp index 04ca8bb91..2e1d050a2 100644 --- a/src/libs/installer/elevatedexecuteoperation.cpp +++ b/src/libs/installer/elevatedexecuteoperation.cpp @@ -204,7 +204,8 @@ bool ElevatedExecuteOperation::Private::run(const QStringList &arguments) if (!success) { q->setError(UserDefinedError); //TODO: pass errorString() through the wrapper */ - q->setErrorString(tr("Execution failed: Could not start: \"%1\"").arg(callstr)); + q->setErrorString(tr("Execution failed: Could not start: \"%1\"(%2)").arg(callstr, + process->errorString())); returnValue = false; } diff --git a/src/libs/installer/fsengineserver.cpp b/src/libs/installer/fsengineserver.cpp index ae8fc0346..b17e1ae0a 100644 --- a/src/libs/installer/fsengineserver.cpp +++ b/src/libs/installer/fsengineserver.cpp @@ -448,6 +448,8 @@ QByteArray FSEngineConnectionThread::handleCommand(const QString &command) returnStream << process->waitForStarted(msecs); } else if (command == QLatin1String("QProcess::workingDirectory")) { returnStream << process->workingDirectory(); + } else if (command == QLatin1String("QProcess::errorString")) { + returnStream << process->errorString(); } else if (command == QLatin1String("QProcess::write")) { QByteArray byteArray; receivedStream >> byteArray; diff --git a/src/libs/installer/qprocesswrapper.cpp b/src/libs/installer/qprocesswrapper.cpp index fab9bd83d..416ca9f4c 100644 --- a/src/libs/installer/qprocesswrapper.cpp +++ b/src/libs/installer/qprocesswrapper.cpp @@ -392,6 +392,14 @@ QString QProcessWrapper::workingDirectory() const return static_cast(d->process.workingDirectory()); } +QString QProcessWrapper::errorString() const +{ + const Private::TimerBlocker blocker(this); + if (d->createSocket()) + return callRemoteMethod(d->stream, QLatin1String("QProcess::errorString")); + return static_cast(d->process.errorString()); +} + void QProcessWrapper::setEnvironment(const QStringList ¶m1) { const Private::TimerBlocker blocker(this); diff --git a/src/libs/installer/qprocesswrapper.h b/src/libs/installer/qprocesswrapper.h index c566c3f07..15e6f1fba 100644 --- a/src/libs/installer/qprocesswrapper.h +++ b/src/libs/installer/qprocesswrapper.h @@ -100,6 +100,7 @@ public: bool waitForFinished(int msecs = 30000); void setEnvironment(const QStringList &environment); QString workingDirectory() const; + QString errorString() const; qint64 write(const QByteArray &byteArray); QProcessWrapper::ProcessChannel readChannel() const; void setReadChannel(QProcessWrapper::ProcessChannel channel); -- cgit v1.2.3