summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2016-07-04 15:58:39 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2016-07-04 15:58:39 +0200
commitb5695bd5be908970244919bcd7c19cbf7ccca2c4 (patch)
tree29f1e2895bef25db5b47e7e2cf01414f6b32ac8d /src/corelib
parent840729a931a7d3fefbc4b4a8e01f8b1bd69a427e (diff)
parentb7744e0b05255fc468db2af215ba94eca4b7757b (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qdir.cpp2
-rw-r--r--src/corelib/io/qsettings_winrt.cpp2
-rw-r--r--src/corelib/io/qurl.cpp10
-rw-r--r--src/corelib/json/qjsondocument.cpp12
-rw-r--r--src/corelib/kernel/qcore_unix_p.h4
-rw-r--r--src/corelib/kernel/qeventloop.cpp6
-rw-r--r--src/corelib/tools/qdatetime.cpp16
7 files changed, 34 insertions, 18 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 9efe2fb90e..f8fae711f2 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -692,7 +692,7 @@ QString QDir::filePath(const QString &fileName) const
{
const QDirPrivate* d = d_ptr.constData();
if (isAbsolutePath(fileName))
- return QString(fileName);
+ return fileName;
QString ret = d->dirEntry.filePath();
if (!fileName.isEmpty()) {
diff --git a/src/corelib/io/qsettings_winrt.cpp b/src/corelib/io/qsettings_winrt.cpp
index 0a87e7ce66..708287ce5e 100644
--- a/src/corelib/io/qsettings_winrt.cpp
+++ b/src/corelib/io/qsettings_winrt.cpp
@@ -92,7 +92,7 @@ static IApplicationDataContainer *subContainer(IApplicationDataContainer *parent
if (FAILED(hr))
return 0;
- while (SUCCEEDED(S_OK) && current) {
+ while (SUCCEEDED(hr) && current) {
ComPtr<ContainerItem> item;
hr = iterator->get_Current(&item);
if (FAILED(hr))
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 451e3b2967..bd2f9de66c 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -984,10 +984,12 @@ inline bool QUrlPrivate::setScheme(const QString &value, int len, bool doSetErro
needsLowercasing = i;
continue;
}
- if (p[i] >= '0' && p[i] <= '9' && i > 0)
- continue;
- if (p[i] == '+' || p[i] == '-' || p[i] == '.')
- continue;
+ if (i) {
+ if (p[i] >= '0' && p[i] <= '9')
+ continue;
+ if (p[i] == '+' || p[i] == '-' || p[i] == '.')
+ continue;
+ }
// found something else
// don't call setError needlessly:
diff --git a/src/corelib/json/qjsondocument.cpp b/src/corelib/json/qjsondocument.cpp
index b2fa16d22a..6eca54bdf0 100644
--- a/src/corelib/json/qjsondocument.cpp
+++ b/src/corelib/json/qjsondocument.cpp
@@ -357,16 +357,14 @@ QByteArray QJsonDocument::toJson(JsonFormat format) const
#endif
/*!
- Parses a UTF-8 encoded JSON document and creates a QJsonDocument
+ Parses \a json as a UTF-8 encoded JSON document, and creates a QJsonDocument
from it.
- \a json contains the json document to be parsed.
+ Returns a valid (non-null) QJsonDocument if the parsing succeeds. If it fails,
+ the returned document will be null, and the optional \a error variable will contain
+ further details about the error.
- The optional \a error variable can be used to pass in a QJsonParseError data
- structure that will contain information about possible errors encountered during
- parsing.
-
- \sa toJson(), QJsonParseError
+ \sa toJson(), QJsonParseError, isNull()
*/
QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error)
{
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index 53f2a50191..125ced6fc9 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -79,6 +79,10 @@
#include <errno.h>
#include <fcntl.h>
+#if !defined(QT_POSIX_IPC) && !defined(QT_NO_SHAREDMEMORY) && !defined(Q_OS_ANDROID)
+# include <sys/ipc.h>
+#endif
+
#if defined(Q_OS_VXWORKS)
# include <ioLib.h>
#endif
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index e960d355e1..e4b819d9d2 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -188,8 +188,10 @@ int QEventLoop::exec(ProcessEventsFlags flags)
{
if (exceptionCaught) {
qWarning("Qt has caught an exception thrown from an event handler. Throwing\n"
- "exceptions from an event handler is not supported in Qt. You must\n"
- "reimplement QApplication::notify() and catch all exceptions there.\n");
+ "exceptions from an event handler is not supported in Qt.\n"
+ "You must not let any exception whatsoever propagate through Qt code.\n"
+ "If that is not possible, in Qt 5 you must at least reimplement\n"
+ "QCoreApplication::notify() and catch all exceptions there.\n");
}
locker.relock();
QEventLoop *eventLoop = d->threadData->eventLoops.pop();
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index b539bef5db..b296361146 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2721,7 +2721,7 @@ qint64 QDateTimePrivate::toMSecsSinceEpoch() const
case Qt::TimeZone:
#ifdef QT_BOOTSTRAPPED
- break;
+ return 0;
#else
return zoneMSecsToEpochMSecs(m_msecs, m_timeZone);
#endif
@@ -4782,7 +4782,12 @@ QDataStream &operator>>(QDataStream &in, QDate &date)
QDataStream &operator<<(QDataStream &out, const QTime &time)
{
- return out << quint32(time.mds);
+ if (out.version() >= QDataStream::Qt_4_0) {
+ return out << quint32(time.mds);
+ } else {
+ // Qt3 had no support for reading -1, QTime() was valid and serialized as 0
+ return out << quint32(time.isNull() ? 0 : time.mds);
+ }
}
/*!
@@ -4797,7 +4802,12 @@ QDataStream &operator>>(QDataStream &in, QTime &time)
{
quint32 ds;
in >> ds;
- time.mds = int(ds);
+ if (in.version() >= QDataStream::Qt_4_0) {
+ time.mds = int(ds);
+ } else {
+ // Qt3 would write 0 for a null time
+ time.mds = (ds == 0) ? QTime::NullTime : int(ds);
+ }
return in;
}