From d5ed6936be137fcb59290b591b46a88e12c34dcd Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 13 Aug 2013 13:38:45 -0700 Subject: Don't compile MD4, MD5, SHA-2 and SHA-3 into qmake We just need one digest algorithm, any algorithm, to generate a somewhat unique identifier. SHA-1 will suffice. Change-Id: I3cb26bf866d616df3ef32feace10934f19daa1a6 Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qcryptographichash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 32f5f0b33a..55195ecd6b 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -46,7 +46,7 @@ #include "../../3rdparty/sha1/sha1.cpp" #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" -- cgit v1.2.3 From 37215efeea7a255e6a0d72bd8f39d476735cc94a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 13 Aug 2013 13:42:55 -0700 Subject: Ensure that bootstrapped users of QCryptographicHash only use SHA-1 This reduces code size quite considerably in the bootstrapped tools. Change-Id: I7475650b1936e93afcf327cb4def2f7763609179 Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qcryptographichash.cpp | 4 ++++ src/corelib/tools/qcryptographichash.h | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 55195ecd6b..f4f465a623 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -45,6 +45,10 @@ #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 and qmake only need SHA-1 #include "../../3rdparty/md5/md5.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); -- cgit v1.2.3 From a6eb28d3f68bec2d4b049da3d0b62808c6525895 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 9 Aug 2013 13:34:04 +0200 Subject: add configure -extprefix option this adds the possibility to put the actual qt installation outside the sysroot it is configured for. this makes it possible to install an x-built qt without "polluting" the sysroot, which makes it possible to have read-only sysroots, and multiple qt builds for one sysroot. -prefix is the location within the sysroot as seen by the target itself, and gets "burned" into QLibraryInfo in QtCore. -extprefix is the location in the host file system and gets "burned" into QLibraryInfo in qmake. if it is not specified, it defaults to the sysrootified prefix, which is the previous behavior. Task-number: QTBUG-26680 Change-Id: Ia43833c4e27733159afeb8c8b9b2d981378d0cd1 Reviewed-by: Thiago Macieira --- src/corelib/global/qlibraryinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 53a3ebbc10..2b305ef68b 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -309,7 +309,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('\\'))) -- cgit v1.2.3 From b314b2b844c83b84ad9229c1c16b25caf08b5523 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 17 Aug 2013 08:46:55 +0800 Subject: Rename template parameter: "I" -> "II" C99 defines the "I" macro in complex.h. qobjectdefs_impl.h can be indirectly included in user code, which raises the possibility of a name clash if the user's compiler supports C99 and the user includes complex.h Change-Id: Ie79ec7baf2d49a34b66a01556c7e57324303dc04 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobjectdefs_impl.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/corelib') 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 struct FunctionPointer { enum {ArgumentCount = -1}; }; template struct FunctorCall; - template - struct FunctorCall, List, R, Function> { + template + struct FunctorCall, List, R, Function> { static void call(Function f, void **arg) { - f((*reinterpret_cast::Type *>(arg[I+1]))...), ApplyReturnValue(arg[0]); + f((*reinterpret_cast::Type *>(arg[II+1]))...), ApplyReturnValue(arg[0]); } }; - template - struct FunctorCall, List, R, SlotRet (Obj::*)(SlotArgs...)> { + template + struct FunctorCall, List, R, SlotRet (Obj::*)(SlotArgs...)> { static void call(SlotRet (Obj::*f)(SlotArgs...), Obj *o, void **arg) { - (o->*f)((*reinterpret_cast::Type *>(arg[I+1]))...), ApplyReturnValue(arg[0]); + (o->*f)((*reinterpret_cast::Type *>(arg[II+1]))...), ApplyReturnValue(arg[0]); } }; - template - struct FunctorCall, List, R, SlotRet (Obj::*)(SlotArgs...) const> { + template + struct FunctorCall, List, R, SlotRet (Obj::*)(SlotArgs...) const> { static void call(SlotRet (Obj::*f)(SlotArgs...) const, Obj *o, void **arg) { - (o->*f)((*reinterpret_cast::Type *>(arg[I+1]))...), ApplyReturnValue(arg[0]); + (o->*f)((*reinterpret_cast::Type *>(arg[II+1]))...), ApplyReturnValue(arg[0]); } }; -- cgit v1.2.3 From 882e01a94f83bc1625d68b279cdde9a38dae0166 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 19 Aug 2013 16:12:17 +0200 Subject: Revert "Disable precision timers when running MSVC2012 code on pre-Windows 8." This reverts commit aa1b4c0943187d82e0c313b93559e99226a9c75a. It turns out that the bug is caused by a different mask constant in Windows 8 which should not take effect in pre-Windows 8. Change-Id: I1ad502262dae42856c07d48ee3bc9dc032ab379b Reviewed-by: Joerg Bornemann --- src/corelib/kernel/qeventdispatcher_win.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index d1bd8fbe95..ae291f13cd 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 #include @@ -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"); -- cgit v1.2.3 From 54f1d7e2e48b896755aa930ee7e4ecacf51bf977 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 19 Aug 2013 16:14:01 +0200 Subject: Use correct mask constant in the Windows event dispatcher. Mask out QS_TOUCH, QS_POINTER when running a VS2012-compiled binary on pre-Windows 8 systems. Task-number: QTBUG-32257 Task-number: QTBUG-28513 Task-number: QTBUG-29097 Task-number: QTBUG-29435 Change-Id: I33ce3a659a234cb04d3b5ae9d668d193d681be7f Reviewed-by: Joerg Bornemann --- src/corelib/kernel/qeventdispatcher_win.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index ae291f13cd..dfb897c0fd 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -430,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) { @@ -439,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 -- cgit v1.2.3 From 8b540f68a8404e4b9e3ac65a22c11416a91ee749 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 19 Aug 2013 09:02:27 +0200 Subject: Tidy up QJsonObject documentation. Change-Id: I445e0573c3c4fdb86ef535299a4eb299e225c15d Reviewed-by: Jerome Pasion Reviewed-by: Lars Knoll --- src/corelib/json/qjsonobject.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/corelib') 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 -- cgit v1.2.3