当前位置: 首页>>代码示例>>C++>>正文


C++ TMsvEntry::SetOwner方法代码示例

本文整理汇总了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;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:63,代码来源:MSVENTRY.CPP


注:本文中的TMsvEntry::SetOwner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。