equal
deleted
inserted
replaced
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
190 { |
190 { |
191 if((*iBlockPtr)[blockIndex]->GetId() == aEntry->GetId()) |
191 if((*iBlockPtr)[blockIndex]->GetId() == aEntry->GetId()) |
192 { |
192 { |
193 if(!aReplace) |
193 if(!aReplace) |
194 { |
194 { |
195 CMsvEntryFreePool::Instance()->ReleaseEntry(aEntry); |
195 CMsvEntryFreePool::Instance()->ReleaseEntryL(aEntry); |
196 aEntry = (*iBlockPtr)[blockIndex]; |
196 aEntry = (*iBlockPtr)[blockIndex]; |
197 return; |
197 return; |
198 } |
198 } |
199 CMsvEntryFreePool::Instance()->ReleaseEntry((*iBlockPtr)[blockIndex]); |
199 CMsvEntryFreePool::Instance()->ReleaseEntryL((*iBlockPtr)[blockIndex]); |
200 iBlockPtr->Remove(blockIndex); |
200 iBlockPtr->Remove(blockIndex); |
201 iBlockPtr->Insert(aEntry, blockIndex); |
201 iBlockPtr->Insert(aEntry, blockIndex); |
202 return; |
202 return; |
203 } |
203 } |
204 } |
204 } |
294 entryFound = EFalse; |
294 entryFound = EFalse; |
295 for(TInt blockIndex = 0; blockIndex < blockSize; ++blockIndex) |
295 for(TInt blockIndex = 0; blockIndex < blockSize; ++blockIndex) |
296 { |
296 { |
297 if(aEntries[listCount+aInitIndex]->GetId() == (*iBlockPtr)[blockIndex]->GetId()) |
297 if(aEntries[listCount+aInitIndex]->GetId() == (*iBlockPtr)[blockIndex]->GetId()) |
298 { |
298 { |
299 CMsvEntryFreePool::Instance()->ReleaseEntry(aEntries[listCount+aInitIndex]); |
299 CMsvEntryFreePool::Instance()->ReleaseEntryL(aEntries[listCount+aInitIndex]); |
300 aEntries.Remove(listCount+aInitIndex); |
300 aEntries.Remove(listCount+aInitIndex); |
301 aEntries.Insert((*iBlockPtr)[blockIndex], listCount+aInitIndex); |
301 aEntries.InsertL((*iBlockPtr)[blockIndex], listCount+aInitIndex); |
302 entryFound = ETrue; |
302 entryFound = ETrue; |
303 break; |
303 break; |
304 } |
304 } |
305 } //for() |
305 } //for() |
306 if(!entryFound) |
306 if(!entryFound) |
431 if((*iBlockPtr)[index]->GetId() == aId) |
431 if((*iBlockPtr)[index]->GetId() == aId) |
432 { |
432 { |
433 if(aForceDelete || (*iBlockPtr)[index]->IsEntryLocked()) |
433 if(aForceDelete || (*iBlockPtr)[index]->IsEntryLocked()) |
434 { |
434 { |
435 aParentIdOfEntry = (*iBlockPtr)[index]->Entry().Parent(); |
435 aParentIdOfEntry = (*iBlockPtr)[index]->Entry().Parent(); |
436 CMsvEntryFreePool::Instance()->ReleaseEntry((*iBlockPtr)[index]); |
436 CMsvEntryFreePool::Instance()->ReleaseEntryL((*iBlockPtr)[index]); |
437 iBlockPtr->Remove(index); |
437 iBlockPtr->Remove(index); |
438 // 2.1.1. If the entry deleted was the last entry in the block, |
438 // 2.1.1. If the entry deleted was the last entry in the block, |
439 // delete the block. |
439 // delete the block. |
440 if(iBlockPtr->Count() == 0) |
440 if(iBlockPtr->Count() == 0) |
441 { |
441 { |
726 _LIT(KParentId, " ParentId: "); |
726 _LIT(KParentId, " ParentId: "); |
727 TInt blockSize = Size(); |
727 TInt blockSize = Size(); |
728 for(TInt index=0; index<blockSize; ++index) |
728 for(TInt index=0; index<blockSize; ++index) |
729 { |
729 { |
730 RBuf text; |
730 RBuf text; |
731 text.Create(150); |
731 text.CreateL(150); |
732 text.Append(KId); |
732 text.Append(KId); |
733 text.AppendNum((*iBlockPtr)[index]->Entry().Id()); |
733 text.AppendNum((*iBlockPtr)[index]->Entry().Id()); |
734 text.Append(KParentId); |
734 text.Append(KParentId); |
735 text.AppendNum((*iBlockPtr)[index]->Entry().Parent()); |
735 text.AppendNum((*iBlockPtr)[index]->Entry().Parent()); |
736 text.Append(_L(" VisibleEntry: ")); |
736 text.Append(_L(" VisibleEntry: ")); |