summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant.cpp
diff options
context:
space:
mode:
authorRohan McGovern <rohan@mcgovern.id.au>2010-03-06 23:44:26 (GMT)
committerRohan McGovern <rohan@mcgovern.id.au>2010-03-06 23:44:26 (GMT)
commitad341d612129287793620bc84d3077afd64f97a4 (patch)
tree3d62b038c34985046ad1f3ff56c1c4e85a194ed2 /src/corelib/kernel/qvariant.cpp
parentb20ef0ade0aec89b969bd0ae7f754c680e390c67 (diff)
parent2458cb45665b0fe3144266122f876bd541de9c42 (diff)
downloadQt-ad341d612129287793620bc84d3077afd64f97a4.zip
Qt-ad341d612129287793620bc84d3077afd64f97a4.tar.gz
Qt-ad341d612129287793620bc84d3077afd64f97a4.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: configure.exe examples/multimedia/audioinput/audioinput.cpp src/corelib/io/qfsfileengine.cpp src/gui/egl/qegl_wince.cpp src/gui/egl/qeglproperties.cpp src/gui/egl/qeglproperties_p.h src/gui/embedded/directfb.pri src/gui/kernel/qapplication_win.cpp src/gui/painting/qdrawutil.cpp src/opengl/qgl_p.h src/sql/drivers/odbc/qsql_odbc.cpp src/sql/drivers/odbc/qsql_odbc.h tests/auto/auto.pro tests/auto/qgl/tst_qgl.cpp translations/assistant_adp_ru.ts
Diffstat (limited to 'src/corelib/kernel/qvariant.cpp')
-rw-r--r--src/corelib/kernel/qvariant.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 227a60d..07c9e53 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -484,9 +484,13 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b)
* QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include
* user defined pointer types. */
const char *const typeName = QMetaType::typeName(a->type);
- if (typeName[qstrlen(typeName) - 1] == '*')
+ uint typeNameLen = qstrlen(typeName);
+ if (typeNameLen > 0 && typeName[typeNameLen - 1] == '*')
return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr);
+ if (a->is_null && b->is_null)
+ return true;
+
return a_ptr == b_ptr;
}