From 2ae20268cac5e8ca02e11d7fa0fefdc8f33303a5 Mon Sep 17 00:00:00 2001 From: Young Ik Cho Date: Thu, 28 Mar 2013 20:57:26 +0900 Subject: [PATCH] fix AppControl result handling Change-Id: Ice8c571540cd293f588e043b2f7cb366ef4d309f Signed-off-by: Young Ik Cho --- src/app/FApp_AppArg.cpp | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/app/FApp_AppArg.cpp b/src/app/FApp_AppArg.cpp index bc319ed..806bdb5 100755 --- a/src/app/FApp_AppArg.cpp +++ b/src/app/FApp_AppArg.cpp @@ -387,15 +387,29 @@ BundleIterFnCb(const char* pKey, const int type, const bundle_keyval_t* pVal, vo bundle_keyval_get_array_val(const_cast(pVal), &pArr, &size, NULL); if (pArr && size > 0) { - String str = static_cast(*pArr); - for (size_t i = 1; i < size; i++) + ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter); + if (pList) { - str += L';'; - str += static_cast(*(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(*(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 { -- 2.7.4