+ processEvents();
+}
+
+
+void SystemcallPrivate::processStarted()
+{
+ state = Running;
+ // why do we get two started signals?
+ //disconnect(proc_, SIGNAL(started()), this, SLOT(processStarted()));
+}
+
+
+void SystemcallPrivate::processFinished(int, QProcess::ExitStatus)
+{
+ state = Finished;
+}
+
+
+void SystemcallPrivate::processError(QProcess::ProcessError)
+{
+ state = Error;
+}
+
+
+QString SystemcallPrivate::errorMessage() const
+{
+ if (!proc_)
+ return "No QProcess available";
+
+ QString message;
+ switch (proc_->error()) {
+ case QProcess::FailedToStart:
+ message = "The process failed to start. Either the invoked program is missing, "
+ "or you may have insufficient permissions to invoke the program.";
+ break;
+ case QProcess::Crashed:
+ message = "The process crashed some time after starting successfully.";
+ break;
+ case QProcess::Timedout:
+ message = "The process timed out. It might be restarted automatically.";
+ break;
+ case QProcess::WriteError:
+ message = "An error occurred when attempting to write to the process-> For example, "
+ "the process may not be running, or it may have closed its input channel.";
+ break;
+ case QProcess::ReadError:
+ message = "An error occurred when attempting to read from the process-> For example, "
+ "the process may not be running.";
+ break;
+ case QProcess::UnknownError:
+ default:
+ message = "An unknown error occured.";
+ break;
+ }
+ return message;