summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-08-21 10:38:57 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-08-21 11:03:18 +0200
commitc8ca300e491c186304d0864a9e870337e891e6f7 (patch)
treef1d991c5960b5acc0bf2a709960e871d48d91acf /src/corelib
parent31c96d34d27f8cad020238df28c10a71b2c4a34f (diff)
parent8b540f68a8404e4b9e3ac65a22c11416a91ee749 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: qmake/doc/src/qmake-manual.qdoc src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/src.pro Change-Id: I0a560826c420e46988da3776bd8f9160c365459a
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qlibraryinfo.cpp2
-rw-r--r--src/corelib/json/qjsonobject.cpp38
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp23
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h18
-rw-r--r--src/corelib/tools/qcryptographichash.cpp6
-rw-r--r--src/corelib/tools/qcryptographichash.h6
6 files changed, 53 insertions, 40 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 18f293bba5..61841cab76 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -320,7 +320,7 @@ QLibraryInfo::location(LibraryLocation loc)
QString ret = rawLocation(loc, FinalPaths);
// Automatically prepend the sysroot to target paths
- if (loc < SysrootPath || loc > LastHostPath) {
+ if ((loc < SysrootPath || loc > LastHostPath) && qt_sysrootify_prefix[12] == 'y') {
QString sysroot = rawLocation(SysrootPath, FinalPaths);
if (!sysroot.isEmpty() && ret.length() > 2 && ret.at(1) == QLatin1Char(':')
&& (ret.at(2) == QLatin1Char('/') || ret.at(2) == QLatin1Char('\\')))
diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp
index 2be9d8891d..43336de2e7 100644
--- a/src/corelib/json/qjsonobject.cpp
+++ b/src/corelib/json/qjsonobject.cpp
@@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
QJsonObject is an implicitly shared class, and shares the data with the document
it has been created from as long as it is not being modified.
- You can convert the array to and from text based JSON through QJsonDocument.
+ You can convert the object to and from text based JSON through QJsonDocument.
*/
/*!
@@ -104,7 +104,7 @@ QT_BEGIN_NAMESPACE
/*!
- Constructs an empty JSON object
+ Constructs an empty JSON object.
\sa isEmpty()
*/
@@ -245,7 +245,7 @@ bool QJsonObject::isEmpty() const
/*!
Returns a QJsonValue representing the value for the key \a key.
- The returned QJsonValue is \c Undefined, if the key does not exist.
+ The returned QJsonValue is QJsonValue::Undefined if the key does not exist.
\sa QJsonValue, QJsonValue::isUndefined()
*/
@@ -266,7 +266,7 @@ QJsonValue QJsonObject::value(const QString &key) const
This does the same as value().
- The returned QJsonValue is \c Undefined, if the key does not exist.
+ The returned QJsonValue is QJsonValue::Undefined if the key does not exist.
\sa value(), QJsonValue, QJsonValue::isUndefined()
*/
@@ -281,7 +281,7 @@ QJsonValue QJsonObject::operator [](const QString &key) const
The return value is of type QJsonValueRef, a helper class for QJsonArray
and QJsonObject. When you get an object of type QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
- the assignment will apply to the character in the QJsonArray of QJsonObject
+ the assignment will apply to the element in the QJsonArray or QJsonObject
from which you got the reference.
\sa value()
@@ -301,13 +301,13 @@ QJsonValueRef QJsonObject::operator [](const QString &key)
/*!
Inserts a new item with the key \a key and a value of \a value.
- If there is already an item with the key \a key then that item's value
+ If there is already an item with the key \a key, then that item's value
is replaced with \a value.
Returns an iterator pointing to the inserted item.
If the value is QJsonValue::Undefined, it will cause the key to get removed
- from the object. The returned iterator will then point to end()
+ from the object. The returned iterator will then point to end().
\sa remove(), take(), QJsonObject::iterator, end()
*/
@@ -382,7 +382,7 @@ void QJsonObject::remove(const QString &key)
Returns a QJsonValue containing the value referenced by \a key.
If \a key was not contained in the object, the returned QJsonValue
- is Undefined.
+ is QJsonValue::Undefined.
\sa insert(), remove(), QJsonValue
*/
@@ -422,7 +422,7 @@ bool QJsonObject::contains(const QString &key) const
}
/*!
- Returns \c true if \a other is equal to this object
+ Returns \c true if \a other is equal to this object.
*/
bool QJsonObject::operator==(const QJsonObject &other) const
{
@@ -447,7 +447,7 @@ bool QJsonObject::operator==(const QJsonObject &other) const
}
/*!
- Returns \c true if \a other is not equal to this object
+ Returns \c true if \a other is not equal to this object.
*/
bool QJsonObject::operator!=(const QJsonObject &other) const
{
@@ -501,7 +501,7 @@ QJsonObject::iterator QJsonObject::find(const QString &key)
*/
/*!
- Returns an const iterator pointing to the item with key \a key in the
+ Returns a const iterator pointing to the item with key \a key in the
map.
If the map contains no item with key \a key, the function
@@ -594,7 +594,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
should use QJsonObject::const_iterator. It is generally good practice to
use QJsonObject::const_iterator on a non-const QJsonObject as well, unless you
need to change the QJsonObject through the iterator. Const iterators are
- slightly faster, and improves code readability.
+ slightly faster, and improve code readability.
The default QJsonObject::iterator constructor creates an uninitialized
iterator. You must initialize it using a QJsonObject function like
@@ -614,8 +614,8 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \typedef QJsonObject::iterator::iterator_category
- A synonym for \e {std::bidirectional_iterator_tag} indicating
- this iterator is a bidirectional iterator.
+ A synonym for \e {std::bidirectional_iterator_tag} indicating
+ this iterator is a bidirectional iterator.
*/
/*! \typedef QJsonObject::iterator::reference
@@ -664,7 +664,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
The return value is of type QJsonValueRef, a helper class for QJsonArray
and QJsonObject. When you get an object of type QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
- the assignment will apply to the character in the QJsonArray of QJsonObject
+ the assignment will apply to the element in the QJsonArray or QJsonObject
from which you got the reference.
\sa key(), operator*()
@@ -679,7 +679,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
The return value is of type QJsonValueRef, a helper class for QJsonArray
and QJsonObject. When you get an object of type QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
- the assignment will apply to the character in the QJsonArray of QJsonObject
+ the assignment will apply to the element in the QJsonArray or QJsonObject
from which you got the reference.
\sa key()
@@ -788,7 +788,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
over it, you must use QJsonObject::iterator instead. It is generally
good practice to use QJsonObject::const_iterator on a non-const QJsonObject as
well, unless you need to change the QJsonObject through the iterator.
- Const iterators are slightly faster and improves code
+ Const iterators are slightly faster and improve code
readability.
The default QJsonObject::const_iterator constructor creates an
@@ -809,8 +809,8 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \typedef QJsonObject::const_iterator::iterator_category
- A synonym for \e {std::bidirectional_iterator_tag} indicating
- this iterator is a bidirectional iterator.
+ A synonym for \e {std::bidirectional_iterator_tag} indicating
+ this iterator is a bidirectional iterator.
*/
/*! \typedef QJsonObject::const_iterator::reference
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index d1bd8fbe95..dfb897c0fd 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -52,8 +52,6 @@
#include "qelapsedtimer.h"
#include "qcoreapplication_p.h"
-#include "qsysinfo.h"
-
#include <private/qthread_p.h>
#include <private/qmutexpool_p.h>
@@ -307,14 +305,8 @@ static void resolveTimerAPI()
#endif
triedResolve = true;
#if !defined(Q_OS_WINCE)
-# if defined(_MSC_VER) && _MSC_VER >= 1700
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) { // QTBUG-27266, Disable when running MSVC2012-built code on pre-Windows 8
-# else
- {
-# endif
qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeSetEvent");
qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeKillEvent");
- }
#else
qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeSetEvent");
qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeKillEvent");
@@ -438,6 +430,18 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
return DefWindowProc(hwnd, message, wp, lp);
}
+static inline UINT inputTimerMask()
+{
+ UINT result = QS_TIMER | QS_INPUT | QS_RAWINPUT;
+ // QTBUG 28513, QTBUG-29097, QTBUG-29435: QS_TOUCH, QS_POINTER became part of
+ // QS_INPUT in Windows Kit 8. They should not be used when running on pre-Windows 8.
+#if defined(_MSC_VER) && _MSC_VER >= 1700
+ if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8)
+ result &= ~(QS_TOUCH | QS_POINTER);
+#endif // _MSC_VER >= 1700
+ return result;
+}
+
LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
{
if (wp == PM_REMOVE) {
@@ -447,7 +451,8 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
MSG *msg = (MSG *) lp;
QEventDispatcherWin32Private *d = q->d_func();
const int localSerialNumber = d->serialNumber.load();
- if (HIWORD(GetQueueStatus(QS_TIMER | QS_INPUT | QS_RAWINPUT)) == 0) {
+ static const UINT mask = inputTimerMask();
+ if (HIWORD(GetQueueStatus(mask)) == 0) {
// no more input or timer events in the message queue, we can allow posted events to be sent normally now
if (d->sendPostedEventsWindowsTimerId != 0) {
// stop the timer to send posted events, since we now allow the WM_QT_SENDPOSTEDEVENTS message
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index 4f44d9204e..d775ef1b65 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -496,22 +496,22 @@ namespace QtPrivate {
template<typename Func> struct FunctionPointer { enum {ArgumentCount = -1}; };
template <typename, typename, typename, typename> struct FunctorCall;
- template <int... I, typename... SignalArgs, typename R, typename Function>
- struct FunctorCall<IndexesList<I...>, List<SignalArgs...>, R, Function> {
+ template <int... II, typename... SignalArgs, typename R, typename Function>
+ struct FunctorCall<IndexesList<II...>, List<SignalArgs...>, R, Function> {
static void call(Function f, void **arg) {
- f((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[I+1]))...), ApplyReturnValue<R>(arg[0]);
+ f((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[II+1]))...), ApplyReturnValue<R>(arg[0]);
}
};
- template <int... I, typename... SignalArgs, typename R, typename... SlotArgs, typename SlotRet, class Obj>
- struct FunctorCall<IndexesList<I...>, List<SignalArgs...>, R, SlotRet (Obj::*)(SlotArgs...)> {
+ template <int... II, typename... SignalArgs, typename R, typename... SlotArgs, typename SlotRet, class Obj>
+ struct FunctorCall<IndexesList<II...>, List<SignalArgs...>, R, SlotRet (Obj::*)(SlotArgs...)> {
static void call(SlotRet (Obj::*f)(SlotArgs...), Obj *o, void **arg) {
- (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[I+1]))...), ApplyReturnValue<R>(arg[0]);
+ (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[II+1]))...), ApplyReturnValue<R>(arg[0]);
}
};
- template <int... I, typename... SignalArgs, typename R, typename... SlotArgs, typename SlotRet, class Obj>
- struct FunctorCall<IndexesList<I...>, List<SignalArgs...>, R, SlotRet (Obj::*)(SlotArgs...) const> {
+ template <int... II, typename... SignalArgs, typename R, typename... SlotArgs, typename SlotRet, class Obj>
+ struct FunctorCall<IndexesList<II...>, List<SignalArgs...>, R, SlotRet (Obj::*)(SlotArgs...) const> {
static void call(SlotRet (Obj::*f)(SlotArgs...) const, Obj *o, void **arg) {
- (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[I+1]))...), ApplyReturnValue<R>(arg[0]);
+ (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[II+1]))...), ApplyReturnValue<R>(arg[0]);
}
};
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 32f5f0b33a..f4f465a623 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -45,8 +45,12 @@
#include "../../3rdparty/sha1/sha1.cpp"
+#if defined(QT_BOOTSTRAPPED) && !defined(QT_CRYPTOGRAPHICHASH_ONLY_SHA1)
+# error "Are you sure you need the other hashing algorithms besides SHA-1?"
+#endif
+
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
-// qdoc only needs SHA-1
+// qdoc and qmake only need SHA-1
#include "../../3rdparty/md5/md5.h"
#include "../../3rdparty/md5/md5.cpp"
#include "../../3rdparty/md4/md4.h"
diff --git a/src/corelib/tools/qcryptographichash.h b/src/corelib/tools/qcryptographichash.h
index d4e75c4667..c4f7c3ab4a 100644
--- a/src/corelib/tools/qcryptographichash.h
+++ b/src/corelib/tools/qcryptographichash.h
@@ -55,9 +55,12 @@ class Q_CORE_EXPORT QCryptographicHash
{
public:
enum Algorithm {
+#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
Md4,
Md5,
- Sha1,
+#endif
+ Sha1 = 2,
+#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
Sha224,
Sha256,
Sha384,
@@ -66,6 +69,7 @@ public:
Sha3_256,
Sha3_384,
Sha3_512
+#endif
};
explicit QCryptographicHash(Algorithm method);