Fix serialize and deserialize of ThemeInfo
authorSangyoon Jang <jeremy.jang@samsung.com>
Wed, 22 Apr 2020 04:04:09 +0000 (13:04 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 25 May 2020 04:28:15 +0000 (13:28 +0900)
Change-Id: I696af4f89729a6dfd5895a51335ae431bc8fed84
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/theme/loader/theme_info.cc
src/theme/loader/theme_info.h

index b9517a5..91e3e86 100644 (file)
 namespace ttm {
 namespace loader {
 
+ThemeInfo::ThemeInfo(const tizen_base::Bundle& bundle) {
+  id_ = bundle.GetString("id");
+  version_ = bundle.GetString("version");
+  tool_version_ = bundle.GetString("tool_version");
+  title_ = bundle.GetString("title");
+  resolution_ = bundle.GetString("resolution");
+  preview_ = bundle.GetString("preview");
+  description_ = bundle.GetString("description");
+}
+
 std::string ThemeInfo::GetId() const {
   return id_;
 }
@@ -71,12 +81,8 @@ bool ThemeInfo::GetBool(const std::string& key) const {
   return true;
 }
 
-int ThemeInfo::Serialize(tizen_base::Bundle& bundle) {
-  return 0;
-}
-
-int ThemeInfo::Deserialize(const tizen_base::Bundle& bundle) {
-  return 0;
+tizen_base::Bundle ThemeInfo::Serialize() {
+  return {};
 }
 
 }  // namespace loader
index 101a6d5..dbfc02c 100644 (file)
@@ -27,12 +27,14 @@ namespace loader {
 
 class ThemeInfo {
  public:
-  ThemeInfo(std::string id, std::string version, std::string tool_version,
-      std::string title, std::string resolution, std::string preview,
-      std::string description)
+  ThemeInfo() { }
+  explicit ThemeInfo(std::string id, std::string version,
+      std::string tool_version, std::string title, std::string resolution,
+      std::string preview, std::string description)
       : id_(id), version_(version), tool_version_(tool_version),
         title_(title), resolution_(resolution), preview_(preview),
         description_(description) { }
+  explicit ThemeInfo(const tizen_base::Bundle& bundle);
 
   std::string GetId() const;
   std::string GetVersion() const;
@@ -47,8 +49,7 @@ class ThemeInfo {
   float GetFloat(const std::string& key) const;
   bool GetBool(const std::string& key) const;
 
-  int Serialize(tizen_base::Bundle& bundle);
-  int Deserialize(const tizen_base::Bundle& bundle);
+  tizen_base::Bundle Serialize();
 
  private:
   std::string id_;