void tst_QContactDetail::keys() { QContactDetail d; QContactDetail d2; QVERIFY(d.key() != d2.key()); d = d2; QVERIFY(d.key() == d2.key()); d.resetKey(); QVERIFY(d.key() != d2.key()); }
QDebug operator<<(QDebug dbg, const QContactDetail& detail) { dbg.nospace() << "QContactDetail(name=" << detail.definitionName() << ", key=" << detail.key(); QVariantMap fields = detail.variantValues(); QVariantMap::const_iterator it; for (it = fields.constBegin(); it != fields.constEnd(); ++it) { dbg.nospace() << ", " << it.key() << '=' << it.value(); } dbg.nospace() << ')'; return dbg.maybeSpace(); }
/* * Inserts the association between \a detail and \a groupName to the map. * The detail must have a key (ie. have already been saved in a contact) and the group name must not * be the empty string. */ void DetailGroupMap::insert(const QString& groupName, const QContactDetail& detail) { Q_ASSERT(!groupName.isEmpty()); mDetailGroupName[detail.key()] = groupName; mDetailById[detail.key()] = detail; }
/* * Replaces the detail currently in the map with \a detail. * The detail must have a key (ie. have already been saved in a contact). */ void DetailGroupMap::update(const QContactDetail& detail) { Q_ASSERT(detail.key()); mDetailById[detail.key()] = detail; }