From: Junghyun Yeon Date: Thu, 18 Feb 2021 06:58:26 +0000 (+0900) Subject: Matching implements and header's prototype X-Git-Tag: submit/tizen/20210317.082331~126 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2cae995e226aed6a9765ec266bed51b7b2d1c2fe;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git Matching implements and header's prototype Signed-off-by: Junghyun Yeon --- diff --git a/src/appinfo_internal.c b/src/appinfo_internal.c index 499fe76..1d14f41 100644 --- a/src/appinfo_internal.c +++ b/src/appinfo_internal.c @@ -14,6 +14,7 @@ #include "pkgmgrinfo_debug.h" #include "pkgmgrinfo_private.h" #include "pkgmgr_parser.h" +#include "pkgmgrinfo_internal.h" static void __free_applications(gpointer data) @@ -671,9 +672,8 @@ catch: API int appinfo_internal_filter_get_list( sqlite3 *db, pkgmgrinfo_appinfo_filter_h filter, - uid_t uid, GHashTable **appinfo_list) { + uid_t uid, const char *locale, GHashTable **appinfo_list) { int ret; - char *locale; GHashTable *list; if (db == NULL || filter == NULL || appinfo_list == NULL) { @@ -681,16 +681,10 @@ API int appinfo_internal_filter_get_list( return PMINFO_R_EINVAL; } - locale = _get_system_locale(); - if (locale == NULL) - return PMINFO_R_ERROR; - list = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, __free_applications); - if (list == NULL) { - free(locale); + if (list == NULL) return PMINFO_R_ERROR; - } ret = _appinfo_get_applications(db, uid, uid, locale, filter, PMINFO_APPINFO_GET_ALL, list); @@ -700,19 +694,15 @@ API int appinfo_internal_filter_get_list( if (ret != PMINFO_R_OK) { g_hash_table_destroy(list); - free(locale); return ret; } if (!g_hash_table_size(list)) { // TODO: add logs that failed to find appid g_hash_table_destroy(list); - free(locale); return PMINFO_R_ENOENT; } *appinfo_list = list; - // TODO: locale should be delivered - free(locale); return ret; } diff --git a/src/common/database/appinfo_db_handler.cc b/src/common/database/appinfo_db_handler.cc index 6700a22..d7db0d0 100644 --- a/src/common/database/appinfo_db_handler.cc +++ b/src/common/database/appinfo_db_handler.cc @@ -54,7 +54,7 @@ bool AppInfoDBHandler::Execute() { GHashTable* list; int ret = appinfo_internal_filter_get_list( - GetConnection(),filter_, uid_, GetLocale().c_str(), &list); + GetConnection(), filter_, uid_, GetLocale().c_str(), &list); if (ret != PMINFO_R_OK) { // TODO: error log return false;