Apply application path to restore 2.x directory structure 50/44750/5 accepted/tizen/mobile/20150729.073546 accepted/tizen/tv/20150729.073603 accepted/tizen/wearable/20150729.073622 submit/tizen/20150729.044523
authorjh5.cho <jh5.cho@samsung.com>
Mon, 27 Jul 2015 10:12:05 +0000 (19:12 +0900)
committerJoonghyun Cho <jh5.cho@samsung.com>
Tue, 28 Jul 2015 01:42:56 +0000 (18:42 -0700)
$HOME/apps_rw/{PKGID}/{APPID}/… to $HOME/apps_rw/{PKGID}/res/wgt…

Change-Id: I9ac512b5abfc38ce6390efb8a465274efaf639cb

src/common/application_data.cc

index 66bc516..eb52a5f 100755 (executable)
@@ -32,6 +32,7 @@ namespace {
 
 const char* kPathSeparator = "/";
 const char* kConfigXml = "config.xml";
+const char* kResWgtPath = "res/wgt";
 
 static std::string GetPackageIdByAppId(const std::string& appid) {
   char* pkgid = NULL;
@@ -43,6 +44,7 @@ static std::string GetPackageIdByAppId(const std::string& appid) {
   if (pkgid != NULL) {
     return std::string(pkgid_ptr.get());
   } else {
+    LOGGER(ERROR) << "Failed to get package id";
     return std::string();
   }
 }
@@ -65,6 +67,7 @@ static std::string GetPackageRootPath(const std::string& pkgid) {
   if (pkg_root_path != NULL) {
     return std::string(path_ptr.get());
   } else {
+    LOGGER(ERROR) << "Failed to get package root path";
     return std::string();
   }
 }
@@ -73,11 +76,9 @@ static std::string GetPackageRootPath(const std::string& pkgid) {
 
 ApplicationData::ApplicationData(const std::string& appid) : app_id_(appid) {
   pkg_id_ = GetPackageIdByAppId(appid);
-
-  if (!pkg_id_.empty()) {
-    application_path_ = GetPackageRootPath(pkg_id_) + kPathSeparator +
-                        appid + kPathSeparator;
-  }
+  if (!pkg_id_.empty())
+    application_path_ = GetPackageRootPath(pkg_id_) + kPathSeparator
+                        + kResWgtPath + kPathSeparator;
 }
 
 ApplicationData::~ApplicationData() {}
@@ -151,7 +152,7 @@ std::shared_ptr<const wgt::parse::CSPInfo>
 bool ApplicationData::LoadManifestData() {
   std::string config_xml_path(application_path_ + kConfigXml);
   if (!utils::Exists(config_xml_path)) {
-    LOGGER(ERROR) << "Failed to load manifest data. : No such file '"
+    LOGGER(ERROR) << "Failed to load manifest data : No such file '"
                   << config_xml_path << "'.";
     return false;
   }