Additional functions of policy and resource management.
[profile/ivi/ico-uxf-homescreen.git] / lib / system-controller / CicoSCAilItems.cpp
index 78cde86..327e6ca 100644 (file)
@@ -42,11 +42,11 @@ CicoSCAilItems::CicoSCAilItems()
 
 /**
  * @brief constructor
- * @param pkg package name(appid) by ail infomation data
- * @param icon icon path and file name by ail infomation data
- * @param nam name by ail infomation data
- * @param ctgry category by ail infomation data
- * @param exe exec path by ail infomation data
+ * @param pkg package name(appid) by ail information data
+ * @param icon icon path and file name by ail information data
+ * @param nam name by ail information data
+ * @param ctgry category by ail information data
+ * @param exe exec path by ail information data
  * @param cateforys environ file data
  */
 CicoSCAilItems::CicoSCAilItems(const char* pkg, const char* icon,
@@ -164,11 +164,11 @@ void CicoSCAilItems::init()
 
 /**
  * @brief constructor
- * @param pkg package name(appid) by ail infomation data
- * @param icon icon path and file name by ail infomation data
- * @param nam name by ail infomation data
- * @param ctgry category by ail infomation data
- * @param exe exec path by ail infomation data
+ * @param pkg package name(appid) by ail information data
+ * @param icon icon path and file name by ail information data
+ * @param nam name by ail information data
+ * @param ctgry category by ail information data
+ * @param exe exec path by ail information data
  * @param cateforys environ file data
  */
 void CicoSCAilItems::setup(const char* pkg, const char* icon,
@@ -178,22 +178,27 @@ void CicoSCAilItems::setup(const char* pkg, const char* icon,
 {
     ICO_TRA("start");
     m_appid.assign(pkg);
+    ICO_DBG("package name=%s", pkg? pkg: "(NULL)");
 
     m_noIcon = ndisp;
     if (NULL != icon) {
         m_icon.assign(icon);
+        ICO_DBG("icon path=%s", icon? icon: "(NULL)");
     }
 
     if (NULL != nam) {
         m_name.assign(nam);
+        ICO_DBG("name=%s", nam? nam: "(NULL)");
     }
 
     if (NULL != exe) {
         m_execPath.assign(exe);
+        ICO_DBG("exec path=%s", exe? exe: "(NULL)");
     }
 
     if (NULL != typ) {
         m_type.assign(typ);
+        ICO_DBG("type=%s", typ? typ: "(NULL)");
     }
 
     categoryParse(categorys);
@@ -249,6 +254,8 @@ void CicoSCAilItems::categoryParse(const std::string categorys)
     inputDevName.clear();
     switchName.clear();
 
+    CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance();
+
     ICO_DBG("category def size = %d", x.size());
     for (it = x.begin(); it != x.end(); it++) {
 
@@ -391,6 +398,16 @@ void CicoSCAilItems::categoryParse(const std::string categorys)
                 continue;
             }
         }
+
+        int categoryID = CSCSC->getCategoryIdbyName(*it);
+        const char* ttt = it->c_str()? it->c_str(): "(NULL)";
+        ICO_DBG("Category %s->%d", ttt, categoryID);
+        if (-1 != categoryID) {
+            ICO_DBG("Category %d -> %d(%s)", m_categoryID, categoryID, ttt);
+            m_categoryID = categoryID;
+            continue;
+        }
+
         ICO_DBG("Parse UNKOWN %s", it->c_str());
     }
     categoryGetDisplay(displayName, layerName, dispZoneName);
@@ -480,7 +497,7 @@ bool CicoSCAilItems::categoryParseCategory(const string& s)
         return false; // unkown category xxx
     }
     m_categoryID = categoryID;
-    ICO_TRA("end");
+    ICO_TRA("end %d", m_categoryID);
     return true;
 }
 
@@ -627,7 +644,7 @@ bool CicoSCAilItems::categoryParseNodisplay(const string& s)
     else {
         m_noIcon = true;
     }
-    ICO_TRA("end");
+    ICO_TRA("end %s", m_noIcon? "true": "false");
     return true;
 }