summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2012-02-01 15:56:40 +0100
committerGunnar Sletta <gunnar.sletta@nokia.com>2012-02-01 16:49:24 +0100
commitd8c4b920f1b7159ea48437a623939abfd217162e (patch)
treea0d10feea7b620ba8cd20849cec5ee06a0334802
parent0fc5c9bc9f113d8783e2b44b6686b5b5a1cba7c7 (diff)
Expose the process errorstring, to help with debugging
Change-Id: Iab69ce0937c57a4ec852247d192e16f73ca3ef27 Reviewed-by: Andrew Christian <andrew.christian@nokia.com>
-rw-r--r--src/core/processbackend.cpp10
-rw-r--r--src/core/processbackend.h2
-rw-r--r--src/core/processfrontend.cpp9
-rw-r--r--src/core/processfrontend.h4
-rw-r--r--src/core/unixprocessbackend.cpp8
-rw-r--r--src/core/unixprocessbackend.h2
6 files changed, 35 insertions, 0 deletions
diff --git a/src/core/processbackend.cpp b/src/core/processbackend.cpp
index c3da1a1..ab220a5 100644
--- a/src/core/processbackend.cpp
+++ b/src/core/processbackend.cpp
@@ -158,6 +158,16 @@ QString ProcessBackend::workingDirectory() const
}
/*!
+ Returns a human-readable description of the last device error that
+ occurred.
+ */
+QString ProcessBackend::errorString() const
+{
+ return QString();
+}
+
+
+/*!
Return the process UID
*/
diff --git a/src/core/processbackend.h b/src/core/processbackend.h
index 87fdff8..333f75a 100644
--- a/src/core/processbackend.h
+++ b/src/core/processbackend.h
@@ -63,6 +63,8 @@ public:
virtual QVariantMap environment() const;
virtual QString workingDirectory() const;
+ virtual QString errorString() const;
+
virtual qint64 uid() const;
virtual qint64 gid() const;
virtual Q_PID pid() const;
diff --git a/src/core/processfrontend.cpp b/src/core/processfrontend.cpp
index 4d0b946..e6d71d3 100644
--- a/src/core/processfrontend.cpp
+++ b/src/core/processfrontend.cpp
@@ -520,6 +520,15 @@ ProcessBackend *ProcessFrontend::backend() const
Only applicable under Linux.
*/
+/*!
+ Returns a human-readable description of the last device error that
+ occurred.
+ */
+QString ProcessFrontend::errorString() const
+{
+ return m_backend->errorString();
+}
+
#include "moc_processfrontend.cpp"
QT_END_NAMESPACE_PROCESSMANAGER
diff --git a/src/core/processfrontend.h b/src/core/processfrontend.h
index a7a8a6a..ffc588e 100644
--- a/src/core/processfrontend.h
+++ b/src/core/processfrontend.h
@@ -69,6 +69,8 @@ class ProcessFrontend : public QObject
Q_PROPERTY(int priority READ priority WRITE setPriority NOTIFY priorityChanged)
Q_PROPERTY(int oomAdjustment READ oomAdjustment WRITE setOomAdjustment NOTIFY oomAdjustmentChanged)
+ Q_PROPERTY(QString errorString READ errorString)
+
public:
virtual ~ProcessFrontend();
@@ -101,6 +103,8 @@ public:
Q_INVOKABLE QVariantMap processInfo() const;
+ QString errorString() const;
+
signals:
void aboutToStart();
void aboutToStop();
diff --git a/src/core/unixprocessbackend.cpp b/src/core/unixprocessbackend.cpp
index c9bf3d6..06eb15b 100644
--- a/src/core/unixprocessbackend.cpp
+++ b/src/core/unixprocessbackend.cpp
@@ -327,6 +327,14 @@ void UnixProcessBackend::readyReadStandardError()
handleStandardError(m_process->readAllStandardError());
}
+/*!
+ \internal
+ */
+QString UnixProcessBackend::errorString() const
+{
+ return m_process->errorString();
+}
+
#include "moc_unixprocessbackend.cpp"
QT_END_NAMESPACE_PROCESSMANAGER
diff --git a/src/core/unixprocessbackend.h b/src/core/unixprocessbackend.h
index ae68ffb..c1a09fe 100644
--- a/src/core/unixprocessbackend.h
+++ b/src/core/unixprocessbackend.h
@@ -70,6 +70,8 @@ public:
virtual qint64 write(const char *data, qint64 maxSize);
+ virtual QString errorString() const;
+
protected:
bool createProcess();
void startProcess();