fix AppControl result handling
authorYoung Ik Cho <youngik.cho@samsung.com>
Thu, 28 Mar 2013 11:57:26 +0000 (20:57 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Thu, 28 Mar 2013 11:58:48 +0000 (20:58 +0900)
Change-Id: Ice8c571540cd293f588e043b2f7cb366ef4d309f
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
src/app/FApp_AppArg.cpp

index bc319ed..806bdb5 100755 (executable)
@@ -387,15 +387,29 @@ BundleIterFnCb(const char* pKey, const int type, const bundle_keyval_t* pVal, vo
                                bundle_keyval_get_array_val(const_cast<bundle_keyval_t*>(pVal), &pArr, &size, NULL);
                                if (pArr && size > 0)
                                {
-                                       String str = static_cast<char*>(*pArr);
-                                       for (size_t i = 1; i < size; i++)
+                                       ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+                                       if (pList)
                                        {
-                                               str += L';';
-                                               str += static_cast<char*>(*(pArr + i));
+                                               pList->Construct();
+
+                                               for (size_t i = 0; i < size; i++)
+                                               {
+                                                       // type unsafe ugly static casting required
+                                                       pList->Add(new (std::nothrow) String(static_cast<char*>(*(pArr + i))));
+                                               }
+
+                                               const int count = pList->GetCount();
+                                               if (count != 0)
+                                               {
+                                                       SysLog(NID_APP, "Adding %d elements for %s", count, pKey);
+                                                       pMap->Add(new (std::nothrow) String(pKey), pList);
+                                               }
+                                               else
+                                               {
+                                                       SysLog(NID_APP, "No object for %s", pKey);
+                                                       delete pList;
+                                               }
                                        }
-
-                                       SysLog(NID_APP, "(%s, %ls)", pKey, str.GetPointer());
-                                       pMap->Add(new (std::nothrow) String(pKey), new (std::nothrow) String(str));
                                }
                                else
                                {