messagingapp/msgui/appengine/src/conversationssummarymodel.cpp
changeset 52 12db4185673b
parent 44 36f374c67aa8
equal deleted inserted replaced
44:36f374c67aa8 52:12db4185673b
   303 // @see header
   303 // @see header
   304 //---------------------------------------------------------------
   304 //---------------------------------------------------------------
   305 void ConversationsSummaryModel::handleBlueToothMessages(QStandardItem& item,
   305 void ConversationsSummaryModel::handleBlueToothMessages(QStandardItem& item,
   306     const CCsConversationEntry& entry)
   306     const CCsConversationEntry& entry)
   307 {
   307 {
   308     //TODO, needs to be revisited again, once BT team provides the solution for
   308     int msgSubType = ConversationsEngineUtility::messageSubType(entry.GetType());
   309     //BT received as Biomsg issue.
   309     if (msgSubType == ConvergedMessage::VCard) 
   310     QString description = XQConversions::s60DescToQString(*(entry.Description()));
   310     {
   311 
   311         UniDataModelLoader* pluginLoader = new UniDataModelLoader;
   312     if (description.contains(".vcf") || description.contains(".ics")) // "vCard"
   312         UniDataModelPluginInterface* bioMsgPlugin = pluginLoader->getDataModelPlugin(
   313     {
   313             ConvergedMessage::BioMsg);
   314         //message sub-type
   314         bioMsgPlugin->setMessageId(entry.EntryId());
   315         item.setData(ConvergedMessage::VCard, MessageSubType);
   315 
   316 
   316         if (bioMsgPlugin->attachmentCount() > 0) 
   317         //parse vcf file to get the details
   317         	{
   318         QString displayName = MsgContactHandler::getVCardDisplayName(
   318             UniMessageInfoList attList = bioMsgPlugin->attachmentList();
   319                 description);
   319             QString attachmentPath = attList[0]->path();
   320         item.setData(displayName, BodyText);
   320 
   321     }
   321             //get display-name and set as bodytext
       
   322             QString displayName = MsgContactHandler::getVCardDisplayName(attachmentPath);
       
   323             item.setData(displayName, BodyText);
       
   324 		
       
   325 						// clear attachement list : its allocated at data model
       
   326             while (!attList.isEmpty()) 
       
   327 						{
       
   328                 delete attList.takeFirst();
       
   329             }
       
   330 
       
   331         }
       
   332         delete pluginLoader;
       
   333     }
       
   334 
   322     else 
   335     else 
   323     {
   336     {
   324         if (description.contains(".vcs")) // "vCalendar"
   337         QString description = XQConversions::s60DescToQString(*(entry.Description()));
       
   338 
       
   339         if (msgSubType == ConvergedMessage::VCal) // "vCalendar"
   325         {
   340         {
   326             //message sub-type
   341             //message sub-type
   327             item.setData(ConvergedMessage::VCal, MessageSubType);
   342             item.setData(ConvergedMessage::VCal, MessageSubType);
   328         }
   343         }
   329         else
   344         else 
   330         {
   345 				{
   331             //message sub-type
   346             //message sub-type
   332             item.setData(ConvergedMessage::None, MessageSubType);
   347             item.setData(ConvergedMessage::None, MessageSubType);
   333         }
   348         }
   334         //for BT messages we show filenames for all other (except vcard) messages
   349         //for BT messages we show filenames for all other (except vcard) messages
   335         //get filename and set as body
   350         //get filename and set as body