qtcontactsmobility/src/versit/qversitproperty.cpp
changeset 31 2a11b5b00470
parent 27 de1630741fbe
--- a/qtcontactsmobility/src/versit/qversitproperty.cpp	Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/src/versit/qversitproperty.cpp	Fri May 14 15:42:23 2010 +0300
@@ -120,10 +120,19 @@
 /*! Returns true if this is equal to \a other; false otherwise. */
 bool QVersitProperty::operator==(const QVersitProperty& other) const
 {
-    return d->mGroups == other.d->mGroups &&
+    bool equal = d->mGroups == other.d->mGroups &&
             d->mName == other.d->mName &&
             d->mParameters == other.d->mParameters &&
-            d->mValue == other.d->mValue;
+            d->mValueType == other.d->mValueType;
+    if (!equal)
+        return false;
+
+    // QVariant doesn't support == on QVersitDocuments - do it manually
+    if (d->mValue.userType() == qMetaTypeId<QVersitDocument>())
+        return  other.d->mValue.userType() == qMetaTypeId<QVersitDocument>()
+            && d->mValue.value<QVersitDocument>() == other.d->mValue.value<QVersitDocument>();
+    else
+        return d->mValue == other.d->mValue;
 }
 
 /*! Returns true if this is not equal to \a other; false otherwise. */