messagingapp/msgui/appengine/src/conversationsengine_p.cpp
changeset 52 12db4185673b
parent 44 36f374c67aa8
--- a/messagingapp/msgui/appengine/src/conversationsengine_p.cpp	Tue Jul 06 14:12:40 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationsengine_p.cpp	Wed Aug 18 09:45:25 2010 +0300
@@ -28,6 +28,12 @@
 #include "conversationlistchangehandler.h"
 #include "debugtraces.h"
 
+
+//CONSTANTS
+/**
+ *Max number of conversation that can be exchanged in IPC call
+ */
+const TInt KMaxConversationIPCLimit =  250;
 //---------------------------------------------------------------
 // ConversationsEnginePrivate::ConversationsEnginePrivate
 // @see header
@@ -42,7 +48,7 @@
     mConversationsSummaryModel(conversationsSummaryModel),
     mConversationsModel(conversationsModel)
 {
-        TRAP_IGNORE(initL());
+        initL();
 }
 
 //---------------------------------------------------------------
@@ -128,8 +134,11 @@
         CleanupStack::PushL(entry);
         mClientConv->SetConversationEntryL(entry);
         CleanupStack::PopAndDestroy(entry);
+        // Reset the values in change handler before initiating a request
+        mConvChangeHandler->ResetValuesForNewConversation();
+        
         //Get the conversations for new conversationId 
-        mServer->GetConversationsL(mClientConv);
+        mServer->GetConversationsL(mClientConv,0,KMaxConversationIPCLimit);
 
         QCRITICAL_WRITE("ConversationsEnginePrivate::getConversationsL end.");
         }   
@@ -310,14 +319,15 @@
 // @see header
 //---------------------------------------------------------------
 void ConversationsEnginePrivate::Conversations(
-    RPointerArray<CCsConversationEntry>& aConversationEntryList)
+    RPointerArray<CCsConversationEntry>& aConversationEntryList,
+    TInt& aTotalCount)
 {
     int error;
     if (mClientConv)
         {
         QCRITICAL_WRITE("ConversationsEnginePrivate::Conversations start.");
 
-        TRAP(error,mConvChangeHandler->ConversationsL(aConversationEntryList));
+        TRAP(error,mConvChangeHandler->ConversationsL(aConversationEntryList,aTotalCount));
 
         QCRITICAL_WRITE("ConversationsEnginePrivate::Conversations end.");
         }
@@ -337,6 +347,21 @@
 }
 
 //---------------------------------------------------------------
+// ConversationsEngine::fetchRemainingConversations
+// @see header
+//---------------------------------------------------------------
+void ConversationsEnginePrivate::fetchRemainingConversations(TInt& aCount)
+    {
+    if ( mServer && mClientConv )
+            {
+                    
+            // Get conversations from server
+             mServer->GetConversationsL(mClientConv, 
+                     (aCount - 1),
+                    KMaxConversationIPCLimit);
+            }
+    }
+//---------------------------------------------------------------
 // ConversationsEnginePrivate::resendMessage()
 // @see header
 //---------------------------------------------------------------