Matching implements and header's prototype
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 18 Feb 2021 06:58:26 +0000 (15:58 +0900)
committer연정현/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <jungh.yeon@samsung.com>
Thu, 18 Feb 2021 11:16:04 +0000 (20:16 +0900)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/appinfo_internal.c
src/common/database/appinfo_db_handler.cc

index 499fe76..1d14f41 100644 (file)
@@ -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;
 }
index 6700a22..d7db0d0 100644 (file)
@@ -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;