From: Jan Olszak Date: Wed, 2 Jan 2013 10:16:17 +0000 (+0100) Subject: Changed PkgName type from DPL::Optional to DPL::String. PART 4 X-Git-Tag: submit/trunk/20130108.041657~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d90f390f0df98710131be3fcffa3d0290daaf825;p=platform%2Fframework%2Fweb%2Fwrt-commons.git Changed PkgName type from DPL::Optional to DPL::String. PART 4 [Issue#] Switching APIs. [Bug] N/A [Cause] N/A [Solution] Changed Pkgname type, changed api methods. [Verification] Build commons, installer. Run all tests. Change-Id: I3c7b8bf85f0fc2406976ff4a5e6e90ba8cc4e337 --- diff --git a/modules/widget_dao/dao/widget_dao_read_only.cpp b/modules/widget_dao/dao/widget_dao_read_only.cpp index 58a8c27..ade490b 100644 --- a/modules/widget_dao/dao/widget_dao_read_only.cpp +++ b/modules/widget_dao/dao/widget_dao_read_only.cpp @@ -404,13 +404,13 @@ DbWidgetHandleList WidgetDAOReadOnly::getHandleList() WidgetPkgNameList WidgetDAOReadOnly::getPkgnameList() { - LogDebug("Getting Pkgname List"); - WidgetPkgNameList_TEMPORARY_API pkgnameList_TEMPORARY_API = getPkgnameList_TEMPORARY_API(); - WidgetPkgNameList pkgnameList; - FOREACH(it,pkgnameList_TEMPORARY_API ){ - pkgnameList.push_back(DPL::Optional(*it)); + LogDebug("Getting Pkgname List "); + SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN + { + WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) + return select->GetValueList(); } - return pkgnameList; + SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get Pkgname list") } WidgetPkgNameList_TEMPORARY_API WidgetDAOReadOnly::getPkgnameList_TEMPORARY_API() diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h b/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h index 17ebf57..444f176 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h @@ -236,7 +236,7 @@ typedef std::multiset DbWidgetFeatureSet; */ typedef std::list DbWidgetHandleList; -typedef std::list > WidgetPkgNameList; //TODO: this cannot be null -> appropriate changes in db schema needed +typedef std::list WidgetPkgNameList; //TODO: this cannot be null -> appropriate changes in db schema needed typedef std::list WidgetPkgNameList_TEMPORARY_API; //TODO: this cannot be null -> appropriate changes in db schema needed class WidgetDAOReadOnly; //forward declaration diff --git a/tests/dao/TestCases_WidgetDAO.cpp b/tests/dao/TestCases_WidgetDAO.cpp index 92e1995..4964038 100644 --- a/tests/dao/TestCases_WidgetDAO.cpp +++ b/tests/dao/TestCases_WidgetDAO.cpp @@ -88,7 +88,7 @@ WidgetPkgName _registerWidget(const WidgetRegisterInfo& regInfo, { WidgetPkgName pkgname; Try { - auto previous = WidgetDAO::getPkgnameList_TEMPORARY_API(); + auto previous = WidgetDAO::getPkgnameList(); // register widget pkgname = WidgetDAO::registerWidgetGenerateTizenId(regInfo, sec); @@ -96,7 +96,7 @@ WidgetPkgName _registerWidget(const WidgetRegisterInfo& regInfo, RUNNER_ASSERT_MSG(!pkgname.empty(), "(called from line " << line << ")"); - auto current = WidgetDAO::getPkgnameList_TEMPORARY_API(); + auto current = WidgetDAO::getPkgnameList(); RUNNER_ASSERT_MSG(previous.size()+1 == current.size(), "(called from line " << line << ")"); @@ -828,7 +828,7 @@ Expected: For all position in database should be returned one item in list */ RUNNER_TEST(widget_dao_test_get_widget_pkgname_list) { - WidgetPkgNameList_TEMPORARY_API pkgnames = WidgetDAO::getPkgnameList_TEMPORARY_API(); + WidgetPkgNameList pkgnames = WidgetDAO::getPkgnameList(); RUNNER_ASSERT(pkgnames.size() >= 3); }