messagingapp/msgui/appengine/src/conversationssummarymodel.cpp
changeset 52 12db4185673b
parent 44 36f374c67aa8
--- a/messagingapp/msgui/appengine/src/conversationssummarymodel.cpp	Tue Jul 06 14:12:40 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationssummarymodel.cpp	Wed Aug 18 09:45:25 2010 +0300
@@ -305,29 +305,44 @@
 void ConversationsSummaryModel::handleBlueToothMessages(QStandardItem& item,
     const CCsConversationEntry& entry)
 {
-    //TODO, needs to be revisited again, once BT team provides the solution for
-    //BT received as Biomsg issue.
-    QString description = XQConversions::s60DescToQString(*(entry.Description()));
-
-    if (description.contains(".vcf") || description.contains(".ics")) // "vCard"
+    int msgSubType = ConversationsEngineUtility::messageSubType(entry.GetType());
+    if (msgSubType == ConvergedMessage::VCard) 
     {
-        //message sub-type
-        item.setData(ConvergedMessage::VCard, MessageSubType);
+        UniDataModelLoader* pluginLoader = new UniDataModelLoader;
+        UniDataModelPluginInterface* bioMsgPlugin = pluginLoader->getDataModelPlugin(
+            ConvergedMessage::BioMsg);
+        bioMsgPlugin->setMessageId(entry.EntryId());
+
+        if (bioMsgPlugin->attachmentCount() > 0) 
+        	{
+            UniMessageInfoList attList = bioMsgPlugin->attachmentList();
+            QString attachmentPath = attList[0]->path();
 
-        //parse vcf file to get the details
-        QString displayName = MsgContactHandler::getVCardDisplayName(
-                description);
-        item.setData(displayName, BodyText);
+            //get display-name and set as bodytext
+            QString displayName = MsgContactHandler::getVCardDisplayName(attachmentPath);
+            item.setData(displayName, BodyText);
+		
+						// clear attachement list : its allocated at data model
+            while (!attList.isEmpty()) 
+						{
+                delete attList.takeFirst();
+            }
+
+        }
+        delete pluginLoader;
     }
+
     else 
     {
-        if (description.contains(".vcs")) // "vCalendar"
+        QString description = XQConversions::s60DescToQString(*(entry.Description()));
+
+        if (msgSubType == ConvergedMessage::VCal) // "vCalendar"
         {
             //message sub-type
             item.setData(ConvergedMessage::VCal, MessageSubType);
         }
-        else
-        {
+        else 
+				{
             //message sub-type
             item.setData(ConvergedMessage::None, MessageSubType);
         }