Fix in "shared" feature for tizen 3.0. 97/45197/1
authorPawel Sikorski <p.sikorski@samsung.com>
Mon, 3 Aug 2015 11:37:14 +0000 (13:37 +0200)
committerPawel Sikorski <p.sikorski@samsung.com>
Mon, 3 Aug 2015 11:37:14 +0000 (13:37 +0200)
Instead of required_version, widget version was used to check the platform
version.
But, required_version should be used here.

Change-Id: I30fea9280937bec0759854ef999941b2530f3926

src/common/context_installer.h
src/wgt/step/step_parse.cc
src/wgt/step/step_wgt_copy_storage_directories.cc
src/wgt/step/step_wgt_create_storage_directories.cc

index 0534fd6..c4dc1d7 100644 (file)
@@ -26,8 +26,6 @@ class ConfigData {
   ConfigData() {}
   /** version pointed in <application> tag*/
   Property<std::string> required_api_version;
-  /** version pointed int <widget> tag*/
-  Property<std::string> required_tizen_version;
 };
 
 class BackendData {
index 92f1420..3083cbd 100755 (executable)
@@ -134,7 +134,6 @@ bool StepParse::FillWidgetInfo(manifest_x* manifest) {
 }
 
 bool StepParse::FillApplicationInfo(manifest_x* manifest) {
-  std::string api_version;
   std::shared_ptr<const TizenApplicationInfo> app_info =
       std::static_pointer_cast<const TizenApplicationInfo>(
           parser_->GetManifestData(app_keys::kTizenApplicationKey));
@@ -150,7 +149,6 @@ bool StepParse::FillApplicationInfo(manifest_x* manifest) {
   manifest->uiapplication->icon =
       reinterpret_cast<icon_x*> (calloc(1, sizeof(icon_x)));
 
-  api_version = app_info->required_version();
   manifest->uiapplication->appid = strdup(app_info->id().c_str());
   manifest->uiapplication->type = strdup("webapp");
 
@@ -291,11 +289,10 @@ common_installer::Step::Status StepParse::process() {
   if (short_name_set.begin() != short_name_set.end())
     short_name = short_name_set.begin()->second;
 
-  const std::string& tizen_version = wgt_info->version();
+  const std::string& package_version = wgt_info->version();
   const std::string& required_api_version = info->required_version();
 
   context_->config_data.get().required_api_version.set(required_api_version);
-  context_->config_data.get().required_tizen_version.set(tizen_version);
   context_->pkgid.set(std::string(manifest->package));
 
   std::shared_ptr<const PermissionsInfo> perm_info =
@@ -323,7 +320,7 @@ common_installer::Step::Status StepParse::process() {
   LOG(DEBUG) << "  id          = " <<  info->id();
   LOG(DEBUG) << "  name        = " <<  name;
   LOG(DEBUG) << "  short_name  = " <<  short_name;
-  LOG(DEBUG) << "  tizen_version     = " <<  tizen_version;
+  LOG(DEBUG) << "  aplication version     = " <<  package_version;
   LOG(DEBUG) << "  icon        = " <<  manifest->uiapplication->icon->name;
   LOG(DEBUG) << "  api_version = " <<  info->required_version();
   LOG(DEBUG) << "  privileges -[";
index 3398f42..ff36a74 100644 (file)
@@ -27,9 +27,9 @@ namespace wgt {
 namespace copy_storage {
 
 common_installer::Step::Status StepWgtCopyStorageDirectories::process() {
-  int rel_version =
-      context_->config_data.get().required_tizen_version.get().at(0) - '0';
-  if (rel_version < 3) {
+  int version =
+      context_->config_data.get().required_api_version.get().at(0) - '0';
+  if (version < 3) {
     LOG(DEBUG) << "Shared directory coping for tizen 2.x";
     return StepCopyStorageDirectories::process();
   }
@@ -43,9 +43,9 @@ common_installer::Step::Status StepWgtCopyStorageDirectories::process() {
 }
 
 common_installer::Step::Status StepWgtCopyStorageDirectories::undo() {
-  int rel_version =
-      context_->config_data.get().required_tizen_version.get().at(0) - '0';
-  if (rel_version < 3) {
+  int version =
+      context_->config_data.get().required_api_version.get().at(0) - '0';
+  if (version < 3) {
     LOG(DEBUG) << "Shared directory coping for tizen 2.x";
     return StepCopyStorageDirectories::undo();
   }
index bf55ae8..f93a251 100644 (file)
@@ -27,10 +27,10 @@ common_installer::Step::Status StepWgtCreateStorageDirectories::process() {
   if (!PrivateDir())
     return Status::ERROR;
 
-  char rel_version =
-      context_->config_data.get().required_tizen_version.get().at(0);
+  char version =
+      context_->config_data.get().required_api_version.get().at(0);
 
-  if ((rel_version-'0') < 3) {
+  if ((version-'0') < 3) {
     LOG(DEBUG) << "Shared directory preparation for tizen 2.x";
     if (!ShareDir())
       return Status::ERROR;