qtmobility/src/versit/qversitproperty.cpp
changeset 8 71781823f776
parent 4 90517678cc4f
child 11 06b8e2af4411
equal deleted inserted replaced
5:453da2cfceef 8:71781823f776
    48 
    48 
    49 QTM_BEGIN_NAMESPACE
    49 QTM_BEGIN_NAMESPACE
    50 
    50 
    51 /*!
    51 /*!
    52   \class QVersitProperty
    52   \class QVersitProperty
    53   \preliminary
       
    54   \brief The QVersitProperty class stores the name, value, groups and parameters of a Versit property.
    53   \brief The QVersitProperty class stores the name, value, groups and parameters of a Versit property.
    55   \ingroup versit
    54   \ingroup versit
    56 
    55 
    57   For example a vCard can be presented as a QVersitDocument that consists of a number of properties
    56   For example a vCard can be presented as a QVersitDocument that consists of a number of properties
    58   such as a name (N), a telephone number (TEL) and an email address (EMAIL) to name a few.
    57   such as a name (N), a telephone number (TEL) and an email address (EMAIL) to name a few.
   118 }
   117 }
   119 
   118 
   120 /*! Returns true if this is equal to \a other; false otherwise. */
   119 /*! Returns true if this is equal to \a other; false otherwise. */
   121 bool QVersitProperty::operator==(const QVersitProperty& other) const
   120 bool QVersitProperty::operator==(const QVersitProperty& other) const
   122 {
   121 {
   123     return d->mGroups == other.d->mGroups &&
   122     bool equal = d->mGroups == other.d->mGroups &&
   124             d->mName == other.d->mName &&
   123             d->mName == other.d->mName &&
   125             d->mParameters == other.d->mParameters &&
   124             d->mParameters == other.d->mParameters &&
   126             d->mValue == other.d->mValue;
   125             d->mValueType == other.d->mValueType;
       
   126     if (!equal)
       
   127         return false;
       
   128 
       
   129     // QVariant doesn't support == on QVersitDocuments - do it manually
       
   130     if (d->mValue.userType() == qMetaTypeId<QVersitDocument>())
       
   131         return  other.d->mValue.userType() == qMetaTypeId<QVersitDocument>()
       
   132             && d->mValue.value<QVersitDocument>() == other.d->mValue.value<QVersitDocument>();
       
   133     else
       
   134         return d->mValue == other.d->mValue;
   127 }
   135 }
   128 
   136 
   129 /*! Returns true if this is not equal to \a other; false otherwise. */
   137 /*! Returns true if this is not equal to \a other; false otherwise. */
   130 bool QVersitProperty::operator!=(const QVersitProperty& other) const
   138 bool QVersitProperty::operator!=(const QVersitProperty& other) const
   131 {
   139 {