messagingapp/msgui/conversationview/src/msgconversationview.cpp
changeset 38 4e4b6adb1024
parent 37 518b245aa84c
child 41 25fe1fe642e3
--- a/messagingapp/msgui/conversationview/src/msgconversationview.cpp	Fri Jun 25 15:47:40 2010 +0530
+++ b/messagingapp/msgui/conversationview/src/msgconversationview.cpp	Tue Jun 29 23:42:47 2010 +0530
@@ -102,10 +102,11 @@
     mContactCardWidget(contactCardWidget),
     mSendUtil(NULL),
     mVkbHost(NULL),
+    mVisibleIndex(),
     mVkbopened(false),
-    mVisibleIndex()
+    mModelPopulated(false),
+    mViewReady(false)
 {
-    connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(onViewReady()));
     //create send utils
     mSendUtil = new MsgSendUtil(this);
     //initialize view
@@ -216,6 +217,18 @@
 }
 
 //---------------------------------------------------------------
+// MsgConversationView::fetchMoreConversations
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationView::fetchMoreConversations()
+{
+    if (mViewReady && mModelPopulated) {
+        ConversationsEngine::instance()->fetchMoreConversations();
+        mViewReady = mModelPopulated = false;
+    }
+}
+
+//---------------------------------------------------------------
 // MsgConversationView::refreshView()
 // @see header file
 //---------------------------------------------------------------
@@ -820,7 +833,7 @@
     QString operation("displaymsg(int)");
     XQAiwRequest* request;
     XQApplicationManager appManager;
-    request = appManager.create(serviceName, "displaymsg", operation, true); // embedded
+    request = appManager.create(serviceName, "displaymsg", operation, false); // embedded
     
     if ( request == NULL )
         {
@@ -828,6 +841,7 @@
         }
 
     args << QVariant(messageId);
+    request->setSynchronous(true);
     
     request->setArguments(args);
     request->send();
@@ -1121,10 +1135,12 @@
 //---------------------------------------------------------------
 void MsgConversationView::populateConversationsView()
 {    
+    mModelPopulated = true;
     mConversationList->setModel(mMessageModel);
     
     refreshView();
     scrollToBottom();
+    fetchMoreConversations();
 }
 
 //---------------------------------------------------------------
@@ -1379,8 +1395,11 @@
 //---------------------------------------------------------------
 void MsgConversationView::onViewReady()
 {
+    mViewReady = true;
     //Disconnect list View's signals, for avoiding execution of the default implementaion
     disconnect(mainWindow(), SIGNAL(aboutToChangeOrientation()), mConversationList, 0);
     disconnect(mainWindow(), SIGNAL(orientationChanged(Qt: rientation)), mConversationList, 0);
+    
+   fetchMoreConversations();
 }
 // EOF