From: Pawel Andruszkiewicz Date: Mon, 5 Oct 2015 13:02:28 +0000 (+0200) Subject: [Messaging] Convert virtual paths to real ones. X-Git-Tag: submit/tizen/20151026.073646^2^2~57^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=39505fa959fde5f2a0748ac027a8afee1e636475;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Messaging] Convert virtual paths to real ones. [Verification] TCT pass rate for SMS/MMS/email is 100% (r47). Change-Id: I295492f3e8a735a06bf6290d4faeb955b7707f0b Signed-off-by: Pawel Andruszkiewicz --- diff --git a/src/messaging/message.cc b/src/messaging/message.cc index 129b1c7d..70bc0ef1 100755 --- a/src/messaging/message.cc +++ b/src/messaging/message.cc @@ -23,6 +23,7 @@ #include "common/logger.h" #include "common/platform_exception.h" #include "common/scope_exit.h" +#include "common/virtual_fs.h" #include "Ecore_File.h" #include "message_email.h" @@ -397,9 +398,7 @@ PlatformResult copyFileToTemp(const std::string& sourcePath, std::string* result std::string dirPath = "/tmp/" + std::string(buf); if ( sourcePath[0] != '/' ) { -// FIXME When filesystem will be available -// attPath = sourcePath; change to attPath = Filesystem::External::fromVirtualPath(sourcePath); - attPath = sourcePath; + attPath = common::VirtualFs::GetInstance().GetRealPath(sourcePath); } else { // Assuming that the path is a real path attPath = sourcePath; } @@ -760,16 +759,9 @@ PlatformResult Message::addMMSBodyAndAttachmentsToStruct(const AttachmentPtrVect if (attach.at(i)->isFilePathSet()) { std::string filepath = attach.at(i)->getFilePath(); LoggerD("att[%d]: org filepath: %s", i, filepath.c_str()); -// TODO uncomment when filesystem will be available -// if(Filesystem::External::isVirtualPath(filepath)) { -// // TODO -// // When introducing below line fromVirtualPath() function -// // needed context, but never used it - allowing for null -// // context pointer. If it appears to need a real context -// // it will need a fix here. -// filepath = Filesystem::External::fromVirtualPath(filepath); -// LoggerD("att[%d]: org virtual filepath: %s", i, filepath.c_str()); -// } + filepath = common::VirtualFs::GetInstance().GetRealPath(filepath); + LoggerD("att[%d]: org virtual filepath: %s", i, filepath.c_str()); + msg_set_str_value(tmpAtt, MSG_MMS_ATTACH_FILEPATH_STR, const_cast(filepath.c_str()), filepath.size()); const size_t last_slash_idx = filepath.find_last_of("\\/");