From: Tomasz Iwanek Date: Tue, 23 Oct 2012 14:46:02 +0000 (+0200) Subject: WrtDAO - getPkgnameList X-Git-Tag: submit/trunk/20121102.073532~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09b87ad5a9c2775053d7b2293cdd32034aed3a0b;p=platform%2Fframework%2Fweb%2Fwrt-commons.git WrtDAO - getPkgnameList [Issue#] N/A [Feature] Listing of installed pkgnames [Cause] N/A [Solution] N/A [Verification] Build & run dpl-tests-db Change-Id: I8dd15f77e6bcbd7fce268404dfbd50694506c872 --- diff --git a/modules/widget_dao/dao/widget_dao_read_only.cpp b/modules/widget_dao/dao/widget_dao_read_only.cpp index 8d29294..7e5abf2 100644 --- a/modules/widget_dao/dao/widget_dao_read_only.cpp +++ b/modules/widget_dao/dao/widget_dao_read_only.cpp @@ -368,6 +368,19 @@ DbWidgetHandleList WidgetDAOReadOnly::getHandleList() SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get handle list") } +WidgetPkgNameList WidgetDAOReadOnly::getPkgnameList() +{ + LogDebug("Getting Pkgname List"); + SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN + { + using namespace DPL::DB::ORM; + using namespace DPL::DB::ORM::wrt; + WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) + return select->GetValueList(); + } + SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get Pkgname list") +} + DbWidgetDAOReadOnlyList WidgetDAOReadOnly::getWidgetList() { LogDebug("Getting DbWidget List"); 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 d801a6a..c3891c4 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,6 +236,8 @@ typedef std::multiset DbWidgetFeatureSet; */ typedef std::list DbWidgetHandleList; +typedef std::list > WidgetPkgNameList; //TODO: this cannot be null -> appropriate changes in db schema needed + class WidgetDAOReadOnly; //forward declaration typedef std::shared_ptr WidgetDAOReadOnlyPtr; /** diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h index 1c28e52..7fdefdd 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h @@ -552,6 +552,12 @@ class WidgetDAOReadOnly */ static DbWidgetHandleList getHandleList(); + /** + * This method returns list of pkgname of installed packages + * @return list of pkgname of installed packages + */ + static WidgetPkgNameList getPkgnameList(); + /** * This method returns a list of all the installed widgets. *