#include "pkgmgrinfo_debug.h"
#include "pkgmgrinfo_private.h"
#include "pkgmgr_parser.h"
+#include "pkgmgrinfo_internal.h"
static void __free_applications(gpointer data)
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) {
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);
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;
}
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;