summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-11-18 09:01:51 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-11-18 09:01:51 +0100
commitc7934f2489e2eb9a539206bab35f335b1943c5bd (patch)
treea27d0ed6c001fe9432e2a0f28fb935acf9e4c65f /src/corelib/io
parentf40593b11199fbef886bfcb6b210a214d8c3adf3 (diff)
parent08f9a1bd6ab9b1777ee5ba163d75e5c848c39eb4 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/network/kernel/qnetworkinterface_winrt.cpp tools/configure/configureapp.cpp Change-Id: I47df00a01597d2e63b334b492b3b4221b29f58ea
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qiodevice.cpp2
-rw-r--r--src/corelib/io/qprocess.cpp5
-rw-r--r--src/corelib/io/qprocess_p.h2
-rw-r--r--src/corelib/io/qprocess_unix.cpp6
-rw-r--r--src/corelib/io/qprocess_win.cpp2
-rw-r--r--src/corelib/io/qprocess_wince.cpp2
6 files changed, 10 insertions, 9 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index ce6225266a..64078b5c54 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -973,7 +973,7 @@ QByteArray QIODevice::read(qint64 maxSize)
/*!
\overload
- Reads all available data from the device, and returns it as a
+ Reads all remaining data from the device, and returns it as a
byte array.
This function has no way of reporting errors; returning an empty
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 3539c75548..b09c99985c 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1179,14 +1179,15 @@ bool QProcessPrivate::_q_startupNotification()
if (startupSocketNotifier)
startupSocketNotifier->setEnabled(false);
- if (processStarted()) {
+ QString errorMessage;
+ if (processStarted(&errorMessage)) {
q->setProcessState(QProcess::Running);
emit q->started(QProcess::QPrivateSignal());
return true;
}
q->setProcessState(QProcess::NotRunning);
- setErrorAndEmit(QProcess::FailedToStart, errorString); // the error string was already set
+ setErrorAndEmit(QProcess::FailedToStart, errorMessage);
#ifdef Q_OS_UNIX
// make sure the process manager removes this entry
waitForDeadChild();
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index fc6b5345d1..d3f251c399 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -352,7 +352,7 @@ public:
#elif defined(QPROCESS_USE_SPAWN)
pid_t spawnChild(pid_t *ppid, const char *workingDirectory, char **argv, char **envp);
#endif
- bool processStarted();
+ bool processStarted(QString *errorMessage = Q_NULLPTR);
void terminateProcess();
void killProcess();
void findExitCode();
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index a958aa4322..38f7ecd568 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -720,7 +720,7 @@ report_errno:
}
#endif
-bool QProcessPrivate::processStarted()
+bool QProcessPrivate::processStarted(QString *errorMessage)
{
char buf[errorBufferMax];
int i = 0;
@@ -744,8 +744,8 @@ bool QProcessPrivate::processStarted()
#endif
// did we read an error message?
- if (i > 0)
- q_func()->setErrorString(QString::fromLocal8Bit(buf, i));
+ if ((i > 0) && errorMessage)
+ *errorMessage = QString::fromLocal8Bit(buf, i);
return i <= 0;
}
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index e77249975c..80e6d5bb61 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -543,7 +543,7 @@ void QProcessPrivate::startProcess()
_q_startupNotification();
}
-bool QProcessPrivate::processStarted()
+bool QProcessPrivate::processStarted(QString * /*errorMessage*/)
{
return processState == QProcess::Running;
}
diff --git a/src/corelib/io/qprocess_wince.cpp b/src/corelib/io/qprocess_wince.cpp
index 807472b7b2..9b63ece15c 100644
--- a/src/corelib/io/qprocess_wince.cpp
+++ b/src/corelib/io/qprocess_wince.cpp
@@ -160,7 +160,7 @@ void QProcessPrivate::startProcess()
_q_startupNotification();
}
-bool QProcessPrivate::processStarted()
+bool QProcessPrivate::processStarted(QString * /*errorMessage*/)
{
return processState == QProcess::Running;
}