diff -r e686773b3f54 -r 04ab22b956c2 phonebookengines/contactsmodel/cntplsql/src/csqlitelocalview.cpp --- a/phonebookengines/contactsmodel/cntplsql/src/csqlitelocalview.cpp Tue Feb 02 10:12:17 2010 +0200 +++ b/phonebookengines/contactsmodel/cntplsql/src/csqlitelocalview.cpp Fri Feb 19 22:40:27 2010 +0200 @@ -606,6 +606,24 @@ 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(); + } + }