messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationupdatehandler.cpp
changeset 43 35b64624a9e7
parent 27 e4592d119491
equal deleted inserted replaced
34:84197e66a4bd 43:35b64624a9e7
    18 #include "testconversationupdatehandler.h"
    18 #include "testconversationupdatehandler.h"
    19 #include "testconversationenginestub.h"
    19 #include "testconversationenginestub.h"
    20 #include "conversationsengine.h"
    20 #include "conversationsengine.h"
    21 #include <conversationsenginedefines.h>
    21 #include <conversationsenginedefines.h>
    22 #include <QStandardItemModel>
    22 #include <QStandardItemModel>
    23 #include <s60qconversions.h>
    23 #include <xqconversions.h>
    24 #include <ccsdefs.h>
    24 #include <ccsdefs.h>
    25 #include <ccsclientconversation.h>
    25 #include <ccsclientconversation.h>
    26 
    26 
    27 
    27 
    28 TConversationUpdateHandler::TConversationUpdateHandler(QObject* parent)
    28 TConversationUpdateHandler::TConversationUpdateHandler(QObject* parent)
    64     
    64     
    65     //get the list with conversation address, 
    65     //get the list with conversation address, 
    66     //as this is common for all the conversation entries 
    66     //as this is common for all the conversation entries 
    67     QModelIndexList indexList = convModel->match(convModel->index(0, 0), 
    67     QModelIndexList indexList = convModel->match(convModel->index(0, 0), 
    68                                                 ConversationAddress, 
    68                                                 ConversationAddress, 
    69                                                 S60QConversions::s60DescToQString(TestConversationEngineStub::Instance()->GetContactID()), 
    69                                                 XQConversions::s60DescToQString(TestConversationEngineStub::Instance()->GetContactID()), 
    70                                                 -1, // One match 
    70                                                 -1, // One match 
    71                                                 Qt::MatchExactly);
    71                                                 Qt::MatchExactly);
    72     entryCount = indexList.count();
    72     entryCount = indexList.count();
    73     
    73     
    74     qDebug() << "entry count " << entryCount;
    74     qDebug() << "entry count " << entryCount;
    84         QCOMPARE(convModel->data(indexList[loop], MessageType).toInt(),
    84         QCOMPARE(convModel->data(indexList[loop], MessageType).toInt(),
    85                 TestConversationEngineStub::Instance()->GetMsgType());
    85                 TestConversationEngineStub::Instance()->GetMsgType());
    86 
    86 
    87         //compare the message description
    87         //compare the message description
    88         QCOMPARE(convModel->data(indexList[loop], BodyText).toString(),
    88         QCOMPARE(convModel->data(indexList[loop], BodyText).toString(),
    89                 S60QConversions::s60DescToQString(
    89                 XQConversions::s60DescToQString(
    90                         TestConversationEngineStub::Instance()->
    90                         TestConversationEngineStub::Instance()->
    91                          GetDescription()));
    91                          GetDescription()));
    92         
    92         
    93         //check the unread message status 
    93         //check the unread message status 
    94         if (convModel->data(indexList[loop], UnReadStatus).toBool())
    94         if (convModel->data(indexList[loop], UnReadStatus).toBool())
   142          int msgCnt = clientConv->GetUnreadMessageCount();
   142          int msgCnt = clientConv->GetUnreadMessageCount();
   143          QCOMPARE(convModel->data(indexList[0], UnreadCount).toInt(), msgCnt);
   143          QCOMPARE(convModel->data(indexList[0], UnreadCount).toInt(), msgCnt);
   144          
   144          
   145          TDesC* dispName = clientConv->GetDisplayName();
   145          TDesC* dispName = clientConv->GetDisplayName();
   146          QCOMPARE(convModel->data(indexList[0], DisplayName).toString(),
   146          QCOMPARE(convModel->data(indexList[0], DisplayName).toString(),
   147                  S60QConversions::s60DescToQString(*dispName));
   147                  XQConversions::s60DescToQString(*dispName));
   148          
   148          
   149          int contactId = clientConv->GetContactId();
   149          int contactId = clientConv->GetContactId();
   150          QCOMPARE(convModel->data(indexList[0], ContactId).toInt(), contactId);
   150          QCOMPARE(convModel->data(indexList[0], ContactId).toInt(), contactId);
   151 
   151 
   152          //need to check the conversation entry
   152          //need to check the conversation entry