本文整理汇总了C++中QContact::clearDetails方法的典型用法代码示例。如果您正苦于以下问题:C++ QContact::clearDetails方法的具体用法?C++ QContact::clearDetails怎么用?C++ QContact::clearDetails使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QContact
的用法示例。
在下文中一共展示了QContact::clearDetails方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bufPtr
//.........这里部分代码省略.........
m_engine.setReadOnlyAccessConstraint(&lastNumber);
currentContact.saveDetail(&lastNumber);
}
}
}
// We have rearched to the end of the number,
// invalidate additional number flag.
isAdditionalNumber = false;
break;
}
case RMobilePhoneBookStore::ETagPBText:
{
if (pbBuffer->GetValue(bufPtr) == KErrNone) {
if (isAdditionalNumber) {
// For additional number bufPtr contains number alpha string,
// this is ignored currently
}
else {
// Contact name otherwise
QContactName name;
QString nameString = QString::fromUtf16(bufPtr.Ptr(), bufPtr.Length());
name.setCustomLabel(nameString);
if (m_storeInfo.m_readOnlyAccess)
m_engine.setReadOnlyAccessConstraint(&name);
currentContact.saveDetail(&name);
QContactManager::Error error(QContactManager::NoError);
m_engine.setContactDisplayLabel(¤tContact, m_engine.synthesizedDisplayLabel(currentContact, &error));
}
}
break;
}
case RMobilePhoneBookStore::ETagPBSecondName:
{
if (pbBuffer->GetValue(bufPtr) == KErrNone) {
QContactNickname nickName;
QString name = QString::fromUtf16(bufPtr.Ptr(), bufPtr.Length());
nickName.setNickname(name);
if (m_storeInfo.m_readOnlyAccess)
m_engine.setReadOnlyAccessConstraint(&nickName);
currentContact.saveDetail(&nickName);
}
break;
}
case RMobilePhoneBookStore::ETagPBNumber:
{
if (pbBuffer->GetValue(bufPtr) == KErrNone) {
QContactPhoneNumber phoneNumber;
QString number = QString::fromUtf16(bufPtr.Ptr(), bufPtr.Length());
phoneNumber.setNumber(number);
if (m_storeInfo.m_readOnlyAccess)
m_engine.setReadOnlyAccessConstraint(&phoneNumber);
currentContact.saveDetail(&phoneNumber);
}
break;
}
case RMobilePhoneBookStore::ETagPBAnrStart:
{
// This tag should precede every additional number entry
isAdditionalNumber = true;
break;
}
case RMobilePhoneBookStore::ETagPBEmailAddress:
{
if (pbBuffer->GetValue(bufPtr) == KErrNone) {
QContactEmailAddress email;
QString emailAddress = QString::fromUtf16(bufPtr.Ptr(), bufPtr.Length());
email.setEmailAddress(emailAddress);
if (m_storeInfo.m_readOnlyAccess)
m_engine.setReadOnlyAccessConstraint(&email);
currentContact.saveDetail(&email);
}
break;
}
case RMobilePhoneBookStore::ETagPBNewEntry:
{
// This signals the end of the entry and is a special case
// which will be handled below.
break;
}
default:
{
// An unsupported field type - just skip this value
pbBuffer->SkipValue(dataType);
break;
}
} //switch
// save contact to the array of contact to be returned if the whole entry was extracted
if ((tagValue == RMobilePhoneBookStore::ETagPBNewEntry && currentContact.localId() > 0) ||
(pbBuffer->RemainingReadLength() == 0 && currentContact.localId() > 0)) {
fetchedContacts.append(currentContact);
//clear current contact
currentContact.clearDetails();
QScopedPointer<QContactId> contactId(new QContactId());
contactId->setLocalId(0);
contactId->setManagerUri(QString());
currentContact.setId(*contactId);
}
} //while