phonebookengines/contactsmodel/cntplsql/src/csqlitelocalview.cpp
changeset 25 76a2435edfd4
parent 24 0ba2181d7c28
child 37 fd64c38c277d
--- a/phonebookengines/contactsmodel/cntplsql/src/csqlitelocalview.cpp	Fri Mar 19 09:27:18 2010 +0200
+++ b/phonebookengines/contactsmodel/cntplsql/src/csqlitelocalview.cpp	Fri Apr 16 14:53:18 2010 +0300
@@ -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();
+			    }
+			
 			}