qtcontactsmobility/src/versit/qversitproperty.cpp
changeset 31 2a11b5b00470
parent 27 de1630741fbe
equal deleted inserted replaced
27:de1630741fbe 31:2a11b5b00470
   118 }
   118 }
   119 
   119 
   120 /*! Returns true if this is equal to \a other; false otherwise. */
   120 /*! Returns true if this is equal to \a other; false otherwise. */
   121 bool QVersitProperty::operator==(const QVersitProperty& other) const
   121 bool QVersitProperty::operator==(const QVersitProperty& other) const
   122 {
   122 {
   123     return d->mGroups == other.d->mGroups &&
   123     bool equal = d->mGroups == other.d->mGroups &&
   124             d->mName == other.d->mName &&
   124             d->mName == other.d->mName &&
   125             d->mParameters == other.d->mParameters &&
   125             d->mParameters == other.d->mParameters &&
   126             d->mValue == other.d->mValue;
   126             d->mValueType == other.d->mValueType;
       
   127     if (!equal)
       
   128         return false;
       
   129 
       
   130     // QVariant doesn't support == on QVersitDocuments - do it manually
       
   131     if (d->mValue.userType() == qMetaTypeId<QVersitDocument>())
       
   132         return  other.d->mValue.userType() == qMetaTypeId<QVersitDocument>()
       
   133             && d->mValue.value<QVersitDocument>() == other.d->mValue.value<QVersitDocument>();
       
   134     else
       
   135         return d->mValue == other.d->mValue;
   127 }
   136 }
   128 
   137 
   129 /*! Returns true if this is not equal to \a other; false otherwise. */
   138 /*! Returns true if this is not equal to \a other; false otherwise. */
   130 bool QVersitProperty::operator!=(const QVersitProperty& other) const
   139 bool QVersitProperty::operator!=(const QVersitProperty& other) const
   131 {
   140 {