diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-07 16:17:29 +0200 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-07 16:18:32 +0200 |
commit | 2346ae167568bb9e5d247da0b946067b7f9aad48 (patch) | |
tree | f3a975711bcd223f4d6803caa5b53c080bb68819 /src/corelib | |
parent | 5dd2713c8ba98e06ae5c4f3da44b2ed73121d247 (diff) | |
parent | 730bc064a070e886e10950ccfd59780e8976f5fd (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I9ee4176f0a0078908d49896508826154c9f71530
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfilesystemengine_win.cpp | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 9 | ||||
-rw-r--r-- | src/corelib/tools/qbytearray.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qvector.h | 2 |
4 files changed, 13 insertions, 6 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index e8904b0ab7..57231b57a9 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -573,9 +573,12 @@ typedef enum { Q_FileIdInfo = 18 } Q_FILE_INFO_BY_HANDLE_CLASS; # if defined(Q_CC_MINGW) || (defined(Q_CC_MSVC) && _MSC_VER < 1700) +// MinGW-64 defines FILE_ID_128 as of gcc-4.8.1 along with FILE_SUPPORTS_INTEGRITY_STREAMS +# if !(defined(Q_CC_MINGW) && defined(FILE_SUPPORTS_INTEGRITY_STREAMS)) typedef struct _FILE_ID_128 { BYTE Identifier[16]; } FILE_ID_128, *PFILE_ID_128; +# endif // !(Q_CC_MINGW && FILE_SUPPORTS_INTEGRITY_STREAMS) typedef struct _FILE_ID_INFO { ULONGLONG VolumeSerialNumber; @@ -614,7 +617,8 @@ QByteArray fileIdWin8(HANDLE handle) &infoEx, sizeof(FILE_ID_INFO))) { result = QByteArray::number(infoEx.VolumeSerialNumber, 16); result += ':'; - result += QByteArray((char *)infoEx.FileId.Identifier, sizeof(infoEx.FileId.Identifier)).toHex(); + // Note: MinGW-64's definition of FILE_ID_128 differs from the MSVC one. + result += QByteArray((char *)&infoEx.FileId, sizeof(infoEx.FileId)).toHex(); } } return result; diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 4dc766ecc5..8d6cf5beb5 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -42,6 +42,7 @@ #include "qmetaobject.h" #include "qmetatype.h" #include "qobject.h" +#include "qmetaobject_p.h" #include <qcoreapplication.h> #include <qcoreevent.h> @@ -2098,8 +2099,12 @@ bool QMetaMethod::invoke(QObject *object, if (qstrcmp(returnValue.name(), retType) != 0) { // normalize the return value as well QByteArray normalized = QMetaObject::normalizedType(returnValue.name()); - if (qstrcmp(normalized.constData(), retType) != 0) - return false; + if (qstrcmp(normalized.constData(), retType) != 0) { + // String comparison failed, try compare the metatype. + int t = returnType(); + if (t == QMetaType::UnknownType || t != QMetaType::type(normalized)) + return false; + } } } diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 20d4339a19..a2d3891f00 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -646,8 +646,6 @@ static inline char qToLower(char c) store raw binary data, and when memory conservation is critical (e.g., with Qt for Embedded Linux). - The maximum array size of a QByteArray is under 2^30. - One way to initialize a QByteArray is simply to pass a \c{const char *} to its constructor. For example, the following code creates a byte array of size 5 containing the data "Hello": diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 288404f3c2..0f2acd6986 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -642,7 +642,7 @@ typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend) iterator moveEnd = d->end(); while (moveBegin != moveEnd) { if (QTypeInfo<T>::isComplex) - abegin->~T(); + static_cast<T *>(abegin)->~T(); new (abegin++) T(*moveBegin++); } if (abegin < d->end()) { |