- Fix condition for getting information from db.
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
if (!g_hash_table_size(appinfo_list) && uid != GLOBAL_USER)
ret = _appinfo_get_applications(db, GLOBAL_USER, uid, locale, filter,
PMINFO_APPINFO_GET_ALL, appinfo_list);
-
- if (ret != PMINFO_R_OK)
- return ret;
-
- if (!g_hash_table_size(appinfo_list))
- return PMINFO_R_ENOENT;
-
return ret;
}
}
}
+ if (g_hash_table_size(list) == 0)
+ ret = PMINFO_R_ENOENT;
+
if (ret == PMINFO_R_OK)
g_hash_table_foreach_steal(list, _move_func, &handle_list_);
for (auto& conn : conn_list) {
ret = pkginfo_internal_filter_get_list(conn, filter_, uid_,
GetLocale().c_str(), list);
- if (ret == PMINFO_R_ERROR)
+ if (ret == PMINFO_R_ERROR) {
_LOGE("Failed to pkginfo_internal_filter_get_list (%d)", ret);
break;
+ }
}
+ if (g_hash_table_size(list) == 0)
+ ret = PMINFO_R_ENOENT;
+
if (ret == PMINFO_R_OK)
g_hash_table_foreach_steal(list, _move_func, &handle_list_);
ret = _pkginfo_get_packages(db, GLOBAL_USER, locale, filter,
PMINFO_PKGINFO_GET_ALL, pkginfo_list);
- if (ret == PMINFO_R_ERROR)
- return ret;
-
- if (!g_hash_table_size(pkginfo_list))
- return PMINFO_R_ENOENT;
-
return PMINFO_R_OK;
}