void CntVersitFavoritePlugin::propertyProcessed( const QVersitDocument& document, const QVersitProperty& property, const QContact& contact, bool* alreadyProcessed, QList<QContactDetail>* updatedDetails) { Q_UNUSED(document); Q_UNUSED(contact); Q_UNUSED(alreadyProcessed); Q_UNUSED(updatedDetails); if (property.name().contains(QLatin1String("X-FAVORITE"), Qt::CaseInsensitive)) { // This method is called before the corresponding detail gets imported to QContact. // Detail is saved after whole versit document is processed. QContactFavorite favorite; favorite.setFavorite(true); favorite.setIndex(property.value().toInt()); mFavoriteDetailList.append(favorite); } }
/*! Returns the hash value for \a key. */ uint qHash(const QVersitProperty &key) { uint hash = QT_PREPEND_NAMESPACE(qHash)(key.name()) + QT_PREPEND_NAMESPACE(qHash)(key.value()); foreach (const QString& group, key.groups()) { hash += QT_PREPEND_NAMESPACE(qHash)(group); } QHash<QString,QString>::const_iterator it = key.parameters().constBegin(); QHash<QString,QString>::const_iterator end = key.parameters().constEnd(); while (it != end) { hash += QT_PREPEND_NAMESPACE(qHash)(it.key()) + QT_PREPEND_NAMESPACE(qHash)(it.value()); ++it; } return hash; }