Modify unnecessary LoadManifestData() function call
authorJongHeon Choi <j-h.choi@samsung.com>
Wed, 8 Jun 2016 03:51:59 +0000 (12:51 +0900)
committerJongHeon Choi <j-h.choi@samsung.com>
Wed, 8 Jun 2016 05:56:06 +0000 (14:56 +0900)
common/application_data.cc
common/application_data.h

index 7c59e75..19acc9a 100644 (file)
@@ -82,7 +82,9 @@ static std::string GetPackageRootPath(const std::string& pkgid) {
 
 }  // namespace
 
-ApplicationData::ApplicationData(const std::string& appid) : app_id_(appid) {
+ApplicationData::ApplicationData(const std::string& appid)
+  : app_id_(appid),
+    loaded_(false) {
   pkg_id_ = GetPackageIdByAppId(appid);
   if (!pkg_id_.empty())
     application_path_ = GetPackageRootPath(pkg_id_) + kPathSeparator
@@ -179,7 +181,12 @@ ApplicationData::AppType ApplicationData::GetAppType() {
 }
 
 bool ApplicationData::LoadManifestData() {
+  if (loaded_) {
+    return true;
+  }
+
   SCOPE_PROFILE();
+
   std::string config_xml_path(application_path_ + kConfigXml);
   if (!utils::Exists(config_xml_path)) {
     LOGGER(ERROR) << "Failed to load manifest data : No such file '"
@@ -270,6 +277,8 @@ bool ApplicationData::LoadManifestData() {
 
   app_type_ = GetAppType();
 
+  loaded_ = true;
+
   return true;
 }
 
index f8c2eba..4f196cd 100644 (file)
@@ -121,6 +121,7 @@ class ApplicationData {
   std::string pkg_id_;
   std::string app_id_;
   ApplicationData::AppType app_type_;
+  bool loaded_;
 };