Refactor pkgmgr-info
[platform/core/appfw/pkgmgr-info.git] / src / server / database / appinfo_db_handler.cc
index de4dcb3..d6b373e 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "pkgmgrinfo_basic.h"
 #include "pkgmgrinfo_internal.h"
-#include "pkgmgrinfo_internal.hh"
 
 namespace {
 
@@ -62,14 +61,13 @@ int AppInfoDBHandler::GetHandleFromDB() {
     return PMINFO_R_ERROR;
   }
 
-  std::vector<std::pair<sqlite3*, uid_t>> conn_list = GetConnection();
+  const auto& conn_list = GetConnection();
   std::vector<std::shared_ptr<application_x>> list;
   int ret = PMINFO_R_OK;
-  for (auto& conn : conn_list) {
-    ret = pkgmgr_server::internal::appinfo_internal_filter_get_list(conn.first,
-        filter_, conn.second, uid_, GetLocale().c_str(), list);
+  for (const auto& [db, uid] : conn_list) {
+    ret = internal::GetAppInfo(db, filter_, uid, uid_, GetLocale(), list);
     if (ret == PMINFO_R_ERROR) {
-      LOG(DEBUG) << "Failed to appinfo_internal_filter_get_list: " << ret;
+      LOG(DEBUG) << "Failed to GetAppInfo: " << ret;
       break;
     }
   }