phonebookengines/contactsmodel/cntplsql/src/csqlitelocalview.cpp
branchRCL_3
changeset 3 04ab22b956c2
parent 0 e686773b3f54
child 64 c1e8ba0c2b16
--- 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();
+                }
+                
 			}