From c32b70597b2f63ed911b5c3c84ec3e895b6e11bd Mon Sep 17 00:00:00 2001 From: Denis Dolzhenko Date: Mon, 12 Sep 2016 14:28:07 +0300 Subject: [PATCH] Fixed: mime for vcalendar event. Change-Id: Ifdb60123e83b5a92933d7c2db45f67b0f0b60ccc Signed-off-by: Denis Dolzhenko --- src/Conversation/ConvList/Controller/inc/BubbleEntityFactory.h | 2 +- src/Conversation/ConvList/Controller/src/BubbleEntityFactory.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Conversation/ConvList/Controller/inc/BubbleEntityFactory.h b/src/Conversation/ConvList/Controller/inc/BubbleEntityFactory.h index fe2b33e..9a3bd55 100644 --- a/src/Conversation/ConvList/Controller/inc/BubbleEntityFactory.h +++ b/src/Conversation/ConvList/Controller/inc/BubbleEntityFactory.h @@ -49,7 +49,7 @@ namespace Msg BubbleDownloadButtonEntity *createDownloadButtonEntity(Message::Direction direction); private: - BubbleEntity *createEntity(const std::string &filePath, const std::string &fileName, const std::string &mime, BubbleBgViewItem::BgType bgType, Message::Direction direction); + BubbleEntity *createEntity(const std::string &filePath, const std::string &fileName, std::string mime, BubbleBgViewItem::BgType bgType, Message::Direction direction); BubbleEntityFactory(BubbleEntityFactory&) = delete; BubbleEntityFactory& operator=(const BubbleEntityFactory&) = delete; diff --git a/src/Conversation/ConvList/Controller/src/BubbleEntityFactory.cpp b/src/Conversation/ConvList/Controller/src/BubbleEntityFactory.cpp index 6364b13..6d5389f 100644 --- a/src/Conversation/ConvList/Controller/src/BubbleEntityFactory.cpp +++ b/src/Conversation/ConvList/Controller/src/BubbleEntityFactory.cpp @@ -75,8 +75,9 @@ BubbleDownloadButtonEntity *BubbleEntityFactory::createDownloadButtonEntity(Mess return new BubbleDownloadButtonEntity(direction); } -BubbleEntity *BubbleEntityFactory::createEntity(const std::string &filePath, const std::string &fileName, const std::string &mime, BubbleBgViewItem::BgType bgType, Message::Direction direction) +BubbleEntity *BubbleEntityFactory::createEntity(const std::string &filePath, const std::string &fileName, std::string mime, BubbleBgViewItem::BgType bgType, Message::Direction direction) { + std::transform(mime.begin(), mime.end(), mime.begin(), ::tolower); if(FileUtils::isExists(filePath)) { MsgMedia::Type msgMediaType = getMsgMediaTypeByMime(mime); @@ -91,7 +92,9 @@ BubbleEntity *BubbleEntityFactory::createEntity(const std::string &filePath, con default: if(mime == "text/x-vcalendar" || mime == "text/calendar") return new BubbleCalEventEntity(filePath, fileName, bgType, direction); - else if(mime == "text/x-vcard" || mime == "text/vcard") + else if(mime == "text/x-vcard" || + mime == "text/vcard" || + mime == "text/x-vcalendar") return new BubbleContactEntity(m_App, filePath, fileName , bgType, direction); else if(mime != "application/smil") return new BubbleUnknownFileEntity(filePath, fileName, bgType, direction); -- 2.7.4