本文整理汇总了C++中TMsvEntry::SetOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ TMsvEntry::SetOwner方法的具体用法?C++ TMsvEntry::SetOwner怎么用?C++ TMsvEntry::SetOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMsvEntry
的用法示例。
在下文中一共展示了TMsvEntry::SetOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoChangeEntry
TInt CMsvServerEntry::DoChangeEntry(const TMsvEntry& aEntry, TSecureId aOwnerId, TBool aForcedUpdate, TBool aBulk)
{
__ASSERT_DEBUG(iEntry.Id()!=KMsvNullIndexEntryId, PanicServer(EMsvEntryWithNoContext1));
__ASSERT_DEBUG(aEntry.Id()==iEntry.Id(), PanicServer(EMsvNotChangingCurrentContext));
__ASSERT_DEBUG(MsvUtils::ValidEntry(aEntry), PanicServer(EMsvBadEntryContents));
__ASSERT_DEBUG(!iEntry.Deleted(), PanicServer(EMsvChangingDeletedEntry));
// can only change the context, and must be valid
if (iEntry.Id()==KMsvNullIndexEntryId || aEntry.Id()!=iEntry.Id() || !MsvUtils::ValidEntry(aEntry))
return KErrNotSupported;
if (iEntry.Deleted() || iEntry.StandardFolder())
return KErrAccessDenied;
TInt error;
TBool permanentDataUnchanged = iEntry.PermanentDataUnchanged(aEntry);
if( permanentDataUnchanged && aForcedUpdate )
{
// Check to see if the owner ID is being updated - if so then need to
// update the permanent data.
permanentDataUnchanged = (iContextOwnerId == aOwnerId);
}
if( permanentDataUnchanged )
{
error = iServer.IndexAdapter().ChangeTemporaryData(aEntry);
if (error==KErrNone)
iEntry.iData = aEntry.iData;
}
else
{
error = IncreaseBufferSizes(aEntry.iDescription.Length(), aEntry.iDetails.Length());
if (error==KErrNone)
{
TMsvEntry entry = aEntry;
// check the hidden flags are correct
entry.SetOwner(iEntry.Owner());
entry.SetDeleted(iEntry.Deleted());
error = iServer.ChangeEntry(entry, aOwnerId, aForcedUpdate, aBulk);
if (error==KErrNone)
{
// switch the context of this object
*iDescription = entry.iDescription;
*iDetails = entry.iDetails;
iEntry = entry;
iEntry.iDescription.Set(*iDescription);
iEntry.iDetails.Set(*iDetails);
}
}
}
// notify everyone of the change unless this is a bulk change.
// for bulk changes (e.g. email synchronize, all notifications get handled elsewhere
if ((error == KErrNone) && (!aBulk))
{
iServer.NotifyChanged(EMsvEntriesChanged, iEntry.Id(), iEntry.Parent());
}
return error;
}