本文整理汇总了C++中CContactItem::SetHasCompressedGuid方法的典型用法代码示例。如果您正苦于以下问题:C++ CContactItem::SetHasCompressedGuid方法的具体用法?C++ CContactItem::SetHasCompressedGuid怎么用?C++ CContactItem::SetHasCompressedGuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContactItem
的用法示例。
在下文中一共展示了CContactItem::SetHasCompressedGuid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateL
/**
Add the given contact item to the database. Forward the call to CPplTableBase
based classes representing the tables in the contact database.
@param aItem The contact item to be added to the database.
@param aSessionId The ID of the session that issued the request. Used to
prevent Phonebook Synchroniser deadlock.
@return Contact item ID of the contact added to the database.
*/
TContactItemId CPplContactItemManager::CreateL(CContactItem& aItem, TUint aSessionId)
{
TBool controlTransaction = !(iTransactionManager.IsTransactionActive());
TBool compressedGuid=EFalse;
// If needed generate a gui for the current contact item
if (aItem.Guid() == TPtrC(KNullDesC))
{
iPreferencePersistor->SetGuidL(aItem, compressedGuid);
}
if (compressedGuid)
{
aItem.SetHasCompressedGuid(compressedGuid);
}
if (aItem.Type() == KUidContactICCEntry)
{
const TInt ret = iContactProperties.ContactSynchroniserL(aSessionId).ValidateWriteContact(static_cast<CContactICCEntry&>(aItem));
User::LeaveIfError(ret);
}
if(controlTransaction)
{
StartTransactionL(aSessionId);
}
iContactTable->CreateInDbL(aItem);
iGroupTable->CreateInDbL(aItem);
iCommAddrTable->CreateInDbL(aItem);
TContactItemId groupId = iIccContactStore.CreateInDbL(aItem, aSessionId);
if(groupId != KNullContactId)
{
//Every ICC entry is added to a special group, created by the Phonebook
//Synchroniser server during the initial synchronisation with the Contacts Model.
CContactItemViewDef* itemDef = CContactItemViewDef::NewLC(CContactItemViewDef::EIncludeFields,CContactItemViewDef::EMaskHiddenFields);
itemDef->AddL(KUidContactFieldMatchAll);
// Add ICC entry to the group.
CContactGroup* grp = static_cast<CContactGroup*>(ReadLC(groupId, *itemDef, EPlAllInfo, aSessionId));
grp->AddContactL(aItem.Id());
UpdateL(*grp, aSessionId);
CleanupStack::PopAndDestroy(2, itemDef); // grp
}
if(controlTransaction)
{
CommitTransactionL();
}
// Assuming success if no leaves at this point, so update
// the metadata search store for this entry
//CCntMetadataOperation* op = CCntMetadataOperation::NewLC(iColSession);
//TRAP_IGNORE(op->SaveContactLD(aItem));
//CleanupStack::Pop(op); // Do not destroy - called LD function
return aItem.Id();
}