EXPORT_C void CUnifiedCertStore::Remove(const CCTCertInfo& aCertInfo, TRequestStatus& aStatus) { BeginAsyncOp(aStatus, ERemove); TRAPD(err, RemoveL(aCertInfo)); if (err != KErrNone) { Complete(err); } }
int Bignum::_Deque::RemoveR() { assert (!IsEmpty()); int ti; _Ary * Node; Node = _Tail->prev; if (Node->prev == NULL) { return RemoveL(); } else { ti = Node->i; Node->prev->next = _Tail; _Tail->prev = Node->prev; delete Node; return ti; } }
char Label::RemoveR() { if (IsEmpty()) { exit(1); return false; } char tch; _Ary * Node; Node = _Tail->prev; if (Node->prev == NULL) { return RemoveL(); } else { tch = Node->ch; Node->prev->next = _Tail; _Tail->prev = Node->prev; delete Node; return tch; } }
/** Database event handler. @param aEvent the database event. */ void CContactLocalView::HandleDatabaseEventL(TContactDbObserverEvent aEvent) { // handle Backup / Restore notifications before checking View State switch (aEvent.iType) { case EContactDbObserverEventBackupBeginning: case EContactDbObserverEventRestoreBeginning: #if defined(__VERBOSE_DEBUG__) RDebug::Print(_L("[CNTMODEL] CContactLocalView{ViewPrefs = 0x%08X}::HandleDatabaseEventL -> Backup/Restore Beginning, state = %i\r\n"), iViewPreferences, iState); #endif if (iState == EReady) { SetState(ENotReady); } else { // stop sorting iViewCntMgr->StopSortL(); } return; case EContactDbObserverEventBackupRestoreCompleted: #if defined(__VERBOSE_DEBUG__) RDebug::Print(_L("[CNTMODEL] CContactLocalView{ViewPrefs = 0x%08X}::HandleDatabaseEventL -> Backup/Restore Completed, state = %i, old sort error %i\r\n"), iViewPreferences, iState, iExtension->iError); #endif if (iState == ENotReady && iExtension->iError == KErrNone) { // view was ready before tables were closed SetState(EReady); } else // view was Initializing (sorting) before tables were closed { // re-read database and sort SafeResort(); } return; default: // other events dealt with below break; } if (iState!=EReady) { if (iViewCntMgr->IsICCSynchronised()) { /* * View events are only queued when the ICC has been synchronised. This prevents * duplicate contacts in an ICC view because add events are not queued until the * SIM is fully synchronised. * * See LUD-5EBHZF "ICC contacts view broadcasts add item events after view is * ready" for more detail. */ #if defined(__VERBOSE_DEBUG__) DebugLogNotification(_L("[CNTMODEL] . . . . . Queueing Database Event "), aEvent); #endif iOutstandingEvents.AppendL(aEvent); // The view state is set to ENotReady when a recovery takes place, and also when the tables // are closed, so set ready here. if (iState == ENotReady && (aEvent.iType == EContactDbObserverEventRecover || aEvent.iType == EContactDbObserverEventTablesOpened)) { SetState(EReady); } // view was Initializing (sorting) before recovery or compression started! if (iState == EInitializing && (aEvent.iType == EContactDbObserverEventRecover || aEvent.iType == EContactDbObserverEventCompress)) { // re-read database and sort SafeResort(); } } #if defined(__VERBOSE_DEBUG__) else { DebugLogNotification(_L("[CNTMODEL] . . . . . Discarding Database Event "), aEvent); } #endif } else { TContactViewEvent event; event.iInt = KErrNone; switch(aEvent.iType) { case EContactDbObserverEventGroupChanged: case EContactDbObserverEventContactChanged: case EContactDbObserverEventOwnCardChanged: { if (aEvent.iType == EContactDbObserverEventGroupChanged) { //Groups are a special case the base view may not contain the group //but a sub view may be such a group and need to know its changed event.iEventType=TContactViewEvent::EGroupChanged; event.iContactId=aEvent.iContactId; NotifyObservers(event); } // Remove from old position, and notify. TRAPD(err,event.iInt=RemoveL(aEvent.iContactId)); if (err == KErrNone && event.iInt != KErrNotFound) { event.iEventType=TContactViewEvent::EItemRemoved; event.iContactId=aEvent.iContactId; NotifyObservers(event); } // Insert at new position, and notify. event.iInt=InsertL(aEvent.iContactId); if (event.iInt != KErrNotFound) { event.iEventType=TContactViewEvent::EItemAdded; event.iContactId=aEvent.iContactId; NotifyObservers(event); } break; } case EContactDbObserverEventContactAdded: case EContactDbObserverEventGroupAdded: #if defined(__VERBOSE_DEBUG__) DebugLogNotification(_L("[CNTMODEL] DatabaseEvent -> Contact/Group Added"), aEvent); #endif event.iInt=InsertL(aEvent.iContactId); if (event.iInt != KErrNotFound) { event.iEventType=TContactViewEvent::EItemAdded; event.iContactId=aEvent.iContactId; NotifyObservers(event); } break; case EContactDbObserverEventContactDeleted: if(aEvent.iContactId == KNullContactId) // KNullContactId indicates a bulk delete. { SetState(EInitializing); // Use initializing state to avoid ESortOrderChanged event being sent to observers. SafeResort(); } else { event.iInt=RemoveL(aEvent.iContactId); if (event.iInt != KErrNotFound) { event.iEventType=TContactViewEvent::EItemRemoved; event.iContactId=aEvent.iContactId; NotifyObservers(event); } } break; case EContactDbObserverEventGroupDeleted: case EContactDbObserverEventOwnCardDeleted: event.iInt=RemoveL(aEvent.iContactId); if (event.iInt != KErrNotFound) { event.iEventType=TContactViewEvent::EItemRemoved; event.iContactId=aEvent.iContactId; NotifyObservers(event); } break; case EContactDbObserverEventUnknownChanges: case EContactDbObserverEventCurrentDatabaseChanged: SetState(EInitializing); // Use initializing state to avoid ESortOrderChanged event being sent to observers. SafeResort(); break; case EContactDbObserverEventSortOrderChanged: // event is not currently used SetState(ENotReady); SafeResort(); break; case EContactDbObserverEventTablesClosed: if (iState == EReady) { SetState(ENotReady); } break; case EContactDbObserverEventTablesOpened: // re-read database and sort SafeResort(); break; case EContactDbObserverEventNull: case EContactDbObserverEventUnused: case EContactDbObserverEventRecover: case EContactDbObserverEventCompress: case EContactDbObserverEventRollback: case EContactDbObserverEventTemplateChanged: case EContactDbObserverEventTemplateDeleted: case EContactDbObserverEventTemplateAdded: case EContactDbObserverEventCurrentItemDeleted: case EContactDbObserverEventCurrentItemChanged: case EContactDbObserverEventPreferredTemplateChanged: case EContactDbObserverEventSpeedDialsChanged: case EContactDbObserverEventRestoreBadDatabase: break; // these events should not come here, but be dealt with at the top of HandleDatabaseEventL case EContactDbObserverEventBackupBeginning: case EContactDbObserverEventRestoreBeginning: case EContactDbObserverEventBackupRestoreCompleted: break; default: ASSERT(EFalse); } } }