small fixes 99/58099/2 devel/ivi submit/devel/ivi/20160204.040934 submit/devel/ivi/20160204.041136 submit/devel/ivi/20160205.010549
authorPawel Sikorski <p.sikorski@samsung.com>
Tue, 26 Jan 2016 09:09:51 +0000 (10:09 +0100)
committerPawel Sikorski <p.sikorski@samsung.com>
Wed, 27 Jan 2016 11:57:44 +0000 (12:57 +0100)
* removing TODOs
* fix cppcheck found errors
* fix compilation warnings

Change-Id: I062cfdad62a10e0609608bb13cbed7354146a0b5

src/manifest_parser/values.cc
src/manifest_parser/values.h
src/tpk_manifest_handlers/widget_application_handler.cc
src/wgt_manifest_handlers/application_icons_handler.cc
src/wgt_manifest_handlers/application_icons_handler.h
src/wgt_manifest_handlers/application_manifest_constants.cc
src/wgt_manifest_handlers/application_manifest_constants.h
src/wgt_manifest_handlers/widget_config_parser.cc

index 00d8e175c7d83480c607fd25d1a0df4b733fd9e9..bed1e321fc514adca7738e4cce6f7516170a7b85 100644 (file)
@@ -405,26 +405,6 @@ void DictionaryValue::SetWithoutPathExpansion(const std::string& key,
   }
 }
 
-void DictionaryValue::SetBooleanWithoutPathExpansion(
-    const std::string& path, bool in_value) {
-  SetWithoutPathExpansion(path, new FundamentalValue(in_value));
-}
-
-void DictionaryValue::SetIntegerWithoutPathExpansion(
-    const std::string& path, int in_value) {
-  SetWithoutPathExpansion(path, new FundamentalValue(in_value));
-}
-
-void DictionaryValue::SetDoubleWithoutPathExpansion(
-    const std::string& path, double in_value) {
-  SetWithoutPathExpansion(path, new FundamentalValue(in_value));
-}
-
-void DictionaryValue::SetStringWithoutPathExpansion(
-    const std::string& path, const std::string& in_value) {
-  SetWithoutPathExpansion(path, new StringValue(in_value));
-}
-
 bool DictionaryValue::Get(const std::string& path,
                           const Value** out_value) const {
   std::string current_path(path);
@@ -720,10 +700,6 @@ void DictionaryValue::MergeDictionary(const DictionaryValue* dictionary) {
   }
 }
 
-void DictionaryValue::Swap(DictionaryValue* other) {
-  dictionary_.swap(other->dictionary_);
-}
-
 DictionaryValue::Iterator::Iterator(const DictionaryValue& target)
     : target_(target),
       it_(target.dictionary_.begin()) {}
@@ -942,58 +918,10 @@ void ListValue::Append(Value* in_value) {
   list_.push_back(in_value);
 }
 
-void ListValue::AppendBoolean(bool in_value) {
-  Append(new FundamentalValue(in_value));
-}
-
-void ListValue::AppendInteger(int in_value) {
-  Append(new FundamentalValue(in_value));
-}
-
-void ListValue::AppendDouble(double in_value) {
-  Append(new FundamentalValue(in_value));
-}
-
-void ListValue::AppendString(const std::string& in_value) {
-  Append(new StringValue(in_value));
-}
-
-void ListValue::AppendStrings(const std::vector<std::string>& in_values) {
-  for (std::vector<std::string>::const_iterator it = in_values.begin();
-       it != in_values.end(); ++it) {
-    AppendString(*it);
-  }
-}
-
-bool ListValue::AppendIfNotPresent(Value* in_value) {
-  assert(in_value);
-  for (ValueVector::const_iterator i(list_.begin()); i != list_.end(); ++i) {
-    if ((*i)->Equals(in_value)) {
-      delete in_value;
-      return false;
-    }
-  }
-  list_.push_back(in_value);
-  return true;
-}
-
-bool ListValue::Insert(size_t index, Value* in_value) {
-  assert(in_value);
-  if (index > list_.size())
-    return false;
-
-  list_.insert(list_.begin() + index, in_value);
-  return true;
-}
-
 ListValue::const_iterator ListValue::Find(const Value& value) const {
   return std::find_if(list_.begin(), list_.end(), ValueEquals(&value));
 }
 
-void ListValue::Swap(ListValue* other) {
-  list_.swap(other->list_);
-}
-
 bool ListValue::GetAsList(ListValue** out_value) {
   if (out_value)
     *out_value = this;
index f5b4d9afb7c5e8974862f3ece73e799145536242..7f9fd25760daae35e83d9b5d29b8c08c4a9fa237 100644 (file)
@@ -233,13 +233,6 @@ class DictionaryValue : public Value {
   // be used as paths.
   void SetWithoutPathExpansion(const std::string& key, Value* in_value);
 
-  // Convenience forms of SetWithoutPathExpansion().
-  void SetBooleanWithoutPathExpansion(const std::string& path, bool in_value);
-  void SetIntegerWithoutPathExpansion(const std::string& path, int in_value);
-  void SetDoubleWithoutPathExpansion(const std::string& path, double in_value);
-  void SetStringWithoutPathExpansion(const std::string& path,
-                                     const std::string& in_value);
-
   // Gets the Value associated with the given path starting from this object.
   // A path has the form "<key>" or "<key>.<key>.[...]", where "." indexes
   // into the next DictionaryValue down.  If the path can be resolved
@@ -322,9 +315,6 @@ class DictionaryValue : public Value {
   // be freed any time after this call.
   void MergeDictionary(const DictionaryValue* dictionary);
 
-  // Swaps contents with the |other| dictionary.
-  virtual void Swap(DictionaryValue* other);
-
   // This class provides an iterator over both keys and values in the
   // dictionary.  It can't be used to modify the dictionary.
   class Iterator {
@@ -421,30 +411,11 @@ class ListValue : public Value {
   // Appends a Value to the end of the list.
   void Append(Value* in_value);
 
-  // Convenience forms of Append.
-  void AppendBoolean(bool in_value);
-  void AppendInteger(int in_value);
-  void AppendDouble(double in_value);
-  void AppendString(const std::string& in_value);
-  void AppendStrings(const std::vector<std::string>& in_values);
-
-  // Appends a Value if it's not already present. Takes ownership of the
-  // |in_value|. Returns true if successful, or false if the value was already
-  // present. If the value was already present the |in_value| is deleted.
-  bool AppendIfNotPresent(Value* in_value);
-
-  // Insert a Value at index.
-  // Returns true if successful, or false if the index was out of range.
-  bool Insert(size_t index, Value* in_value);
-
   // Searches for the first instance of |value| in the list using the Equals
   // method of the Value type.
   // Returns a const_iterator to the found item or to end() if none exists.
   const_iterator Find(const Value& value) const;
 
-  // Swaps contents with the |other| list.
-  virtual void Swap(ListValue* other);
-
   // Iteration.
   iterator begin() { return list_.begin(); }
   iterator end() { return list_.end(); }
index 3d5e99a357f04d01640a5e5af080497d02cec6a1..7bc576900a2b00859624313a3e8bcfffdaf4feb9 100644 (file)
@@ -41,10 +41,6 @@ const char kWidgetApplicationKey[] = "manifest.widget-application";
 // manifest
 const char kManifestKey[] = "manifest";
 
-bool IsBooleanString(const std::string& value) {
-  return ba::iequals(value, "true") || ba::iequals(value, "false");
-}
-
 }  // namespace
 
 template<>
index 0971d2466eb0997368b00794e128cb3e05b18d90..c83f1e6cf21441aba8f222b1b7c9630fdbfd488d 100644 (file)
@@ -99,16 +99,6 @@ const std::string& ApplicationIcon::path() const {
   return path_;
 }
 
-void ApplicationIcon::set_width(int width) {
-  if (width >= 0)
-    width_ = width;
-}
-
-void ApplicationIcon::set_height(int height) {
-  if (height >= 0)
-    height_ = height;
-}
-
 std::string ApplicationIconsInfo::Key() {
   return kIconsKey;
 }
@@ -173,7 +163,7 @@ bool ApplicationIconsHandler::AlwaysParseForKey() const {
 }
 
 std::string ApplicationIconsHandler::Key() const {
-  return wgt::application_manifest_keys::kIconsKey;
+  return wgt::application_widget_keys::kIconsKey;
 }
 
 }  // namespace parse
index 2bbe4dad13a316a73cad7526c727decead7119d2..f58c345dc35b63928765dd54ef00a615cb13902f 100644 (file)
@@ -35,16 +35,6 @@ class ApplicationIcon {
    * @return string to the path
    */
   const std::string& path() const;
-  /**
-   * @brief set_width sets width
-   * @param width
-   */
-  void set_width(int width);
-  /**
-   * @brief set_height sets height
-   * @param height
-   */
-  void set_height(int height);
 
  private:
   std::string path_;
index 93f8b898e1b1a4b39164fc6b4892d9850abaa2b9..82376b20bfd3768f41ff116a714ce9589277e174 100644 (file)
@@ -7,14 +7,6 @@
 
 namespace wgt {
 
-namespace application_manifest_keys {
-
-// TODO(p.sikorski): below key should be removed, when nwrt and app-installer
-// will stop use it. Now, it is just copied.
-const char kIconsKey[] = "icons";
-
-}  // namespace application_manifest_keys
-
 // manifest keys for widget applications.
 namespace application_widget_keys {
 
index 2516e6eba40f637442e555d4d1482b5fd7cd5249..3979b6ce8873d667b4218e9eb4824f386dd82323 100644 (file)
 
 // Keys used in JSON representation of applications.
 namespace wgt {
-namespace application_manifest_keys {
-
-// TODO(p.sikorski): below key should be removed, when nwrt and app-installer
-// will stop use it. Now, it is just copied.
-extern const char kIconsKey[];
-
-}  // namespace application_manifest_keys
 
 namespace application_widget_keys {
 
index f1950c09d89052aea2538a479ef02bb6d6f5a7f7..ed3f3493d320caeb934ede455229b82658daa880 100644 (file)
@@ -301,7 +301,7 @@ bool WidgetConfigParser::CheckServicesStartFiles() {
 bool WidgetConfigParser::CheckWidgetIcons() {
   std::shared_ptr<ApplicationIconsInfo> icons_info =
       std::static_pointer_cast<ApplicationIconsInfo>(
-          parser_->AccessManifestData(application_manifest_keys::kIconsKey));
+          parser_->AccessManifestData(application_widget_keys::kIconsKey));
   if (!icons_info) {
     error_ = "Failed to get icon info";
     return false;