From: Damian Pietruchowski Date: Tue, 4 Apr 2017 09:55:59 +0000 (+0200) Subject: Unnecessary queries if pkg_id is empty X-Git-Tag: accepted/tizen/4.0/unified/20170816.010534~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F123069%2F5;p=platform%2Fcore%2Fappfw%2Fwgt-backend.git Unnecessary queries if pkg_id is empty Change-Id: I825867e85142e704a50ecde510c4a8b72d97ae84 Signed-off-by: Damian Pietruchowski --- diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc index 6157663..1844dec 100644 --- a/src/wgt/step/configuration/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -273,19 +273,24 @@ bool StepParse::FillWidgetInfo(manifest_x* manifest) { manifest->installlocation = strdup("auto"); } - // set update true if package is updated preload package - ci::RequestType req_type = context_->request_type.get(); - if (ci::QueryIsUpdatedPackage(context_->pkgid.get(), context_->uid.get())) - manifest->update = strdup("true"); - else if (ci::QueryIsPreloadPackage(context_->pkgid.get(), - context_->uid.get()) && - (req_type == ci::RequestType::Update || - req_type == ci::RequestType::Delta || - req_type == ci::RequestType::MountUpdate || - req_type == ci::RequestType::ReadonlyUpdateInstall)) - manifest->update = strdup("true"); - else + if (!context_->pkgid.get().empty()) { + // set update true if package is updated preload package + ci::RequestType req_type = context_->request_type.get(); + if (ci::QueryIsUpdatedPackage(context_->pkgid.get(), context_->uid.get())) + manifest->update = strdup("true"); + else if (ci::QueryIsPreloadPackage(context_->pkgid.get(), + context_->uid.get()) && + (req_type == ci::RequestType::Update || + req_type == ci::RequestType::Delta || + req_type == ci::RequestType::MountUpdate || + req_type == ci::RequestType::ReadonlyUpdateInstall)) + manifest->update = strdup("true"); + else + manifest->update = strdup("false"); + } + else { manifest->update = strdup("false"); + } return true; }