summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-03-10 16:39:05 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-03-11 20:08:50 +0100
commit50d0f57b77b8088875d7185c5906b5f57985d5fb (patch)
tree16d21bb5f558461511258f493159658ccecc696a /src/corelib/io
parent713282dfe41fbad1c1c940cec54227cd7c267831 (diff)
parent45dc347a95fd674cefcf5d1ac63b01557fcb2fef (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define and undef in src/corelib/tools/qsimd_p.h. This change is also squashed with "Fall back to c++11 standard compiler flag for host builds" which is done by Peter Seiderer. Conflicts: mkspecs/features/default_post.prf src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch src/3rdparty/sqlite/sqlite3.c src/corelib/tools/qsimd_p.h src/gui/kernel/qevent.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/bearer/blackberry/blackberry.pro src/plugins/platforms/cocoa/qcocoasystemsettings.mm src/plugins/platformthemes/gtk2/gtk2.pro src/plugins/styles/bb10style/bb10style.pro src/sql/drivers/sqlite2/qsql_sqlite2.cpp tools/configure/configureapp.cpp Task-number: QTBUG-51644 Done-with: Peter Seiderer <ps.report@gmx.net> Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qfilesystemiterator_win.cpp7
-rw-r--r--src/corelib/io/qprocess.h2
-rw-r--r--src/corelib/io/qprocess_win.cpp6
-rw-r--r--src/corelib/io/qsettings_win.cpp6
-rw-r--r--src/corelib/io/qtextstream.cpp19
5 files changed, 21 insertions, 19 deletions
diff --git a/src/corelib/io/qfilesystemiterator_win.cpp b/src/corelib/io/qfilesystemiterator_win.cpp
index 2caf87a7b4..ba195b2330 100644
--- a/src/corelib/io/qfilesystemiterator_win.cpp
+++ b/src/corelib/io/qfilesystemiterator_win.cpp
@@ -37,13 +37,6 @@
**
****************************************************************************/
-#if !defined(WINAPI_FAMILY)
-# if _WIN32_WINNT < 0x0500
-# undef _WIN32_WINNT
-# define _WIN32_WINNT 0x0500
-# endif // _WIN32_WINNT < 0x500
-#endif // !WINAPI_FAMILY
-
#include "qfilesystemiterator_p.h"
#include "qfilesystemengine_p.h"
#include "qplatformdefs.h"
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index fd835d18b1..4ce0503761 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -269,7 +269,7 @@ Q_SIGNALS:
void finished(int exitCode); // ### Qt 6: merge the two signals with a default value
void finished(int exitCode, QProcess::ExitStatus exitStatus);
#if QT_DEPRECATED_SINCE(5,6)
- QT_MOC_COMPAT void error(QProcess::ProcessError error);
+ void error(QProcess::ProcessError error);
#endif
void errorOccurred(QProcess::ProcessError error);
void stateChanged(QProcess::ProcessState state, QPrivateSignal);
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 611ce34550..ef787832a4 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -665,7 +665,8 @@ bool QProcessPrivate::waitForReadyRead(int msecs)
return false;
if (WaitForSingleObjectEx(pid->hProcess, 0, false) == WAIT_OBJECT_0) {
bool readyReadEmitted = drainOutputPipes();
- _q_processDied();
+ if (pid)
+ _q_processDied();
return readyReadEmitted;
}
@@ -770,7 +771,8 @@ bool QProcessPrivate::waitForFinished(int msecs)
if (WaitForSingleObject(pid->hProcess, timer.nextSleepTime()) == WAIT_OBJECT_0) {
drainOutputPipes();
- _q_processDied();
+ if (pid)
+ _q_processDied();
return true;
}
diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp
index f74f52df89..05ed51e999 100644
--- a/src/corelib/io/qsettings_win.cpp
+++ b/src/corelib/io/qsettings_win.cpp
@@ -510,6 +510,12 @@ bool QWinSettingsPrivate::readKey(HKEY parentHandle, const QString &rSubKey, QVa
return false;
}
+ // workaround for rare cases where trailing '\0' are missing in registry
+ if (dataType == REG_SZ || dataType == REG_EXPAND_SZ)
+ dataSize += 2;
+ else if (dataType == REG_MULTI_SZ)
+ dataSize += 4;
+
// get the value
QByteArray data(dataSize, 0);
res = RegQueryValueEx(handle, reinterpret_cast<const wchar_t *>(rSubkeyName.utf16()), 0, 0,
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index bc4a5fa538..27b7570226 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -456,6 +456,10 @@ bool QTextStreamPrivate::fillReadBuffer(qint64 maxBytes)
bytesRead = device->read(buf, sizeof(buf));
}
+ // reset the Text flag.
+ if (textModeEnabled)
+ device->setTextModeEnabled(true);
+
if (bytesRead <= 0)
return false;
@@ -491,10 +495,6 @@ bool QTextStreamPrivate::fillReadBuffer(qint64 maxBytes)
readBuffer += QString::fromLatin1(buf, bytesRead);
#endif
- // reset the Text flag.
- if (textModeEnabled)
- device->setTextModeEnabled(true);
-
// remove all '\r\n' in the string.
if (readBuffer.size() > oldReadBufferSize && textModeEnabled) {
QChar CR = QLatin1Char('\r');
@@ -593,17 +593,18 @@ void QTextStreamPrivate::flushWriteBuffer()
qDebug("QTextStreamPrivate::flushWriteBuffer(), device->write(\"%s\") == %d",
qt_prettyDebug(data.constData(), qMin(data.size(),32), data.size()).constData(), int(bytesWritten));
#endif
- if (bytesWritten <= 0) {
- status = QTextStream::WriteFailed;
- return;
- }
#if defined (Q_OS_WIN)
- // replace the text flag
+ // reset the text flag
if (textModeEnabled)
device->setTextModeEnabled(true);
#endif
+ if (bytesWritten <= 0) {
+ status = QTextStream::WriteFailed;
+ return;
+ }
+
// flush the file
#ifndef QT_NO_QOBJECT
QFileDevice *file = qobject_cast<QFileDevice *>(device);