summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FScl_AddressbookFilterImpl.cpp4
-rw-r--r--src/FScl_AddressbookUtil.h8
-rw-r--r--src/FScl_CategoryImpl.cpp6
-rw-r--r--src/FScl_ContactImpl.cpp4
-rw-r--r--src/FScl_UserProfileImpl.cpp4
5 files changed, 9 insertions, 17 deletions
diff --git a/src/FScl_AddressbookFilterImpl.cpp b/src/FScl_AddressbookFilterImpl.cpp
index 646998e..88ae63f 100644
--- a/src/FScl_AddressbookFilterImpl.cpp
+++ b/src/FScl_AddressbookFilterImpl.cpp
@@ -24,7 +24,7 @@
#include <FBaseSysLog.h>
#include <FSclAddressbookFilter.h>
#include <FBase_StringConverter.h>
-#include "FScl_AddressbookUtil.h"
+#include "FScl_ContactDbConnector.h"
#include "FScl_AddressbookFilterImpl.h"
using namespace Tizen::App;
@@ -167,7 +167,7 @@ _AddressbookFilterImpl::_AddressbookFilterImpl(AddressbookFilterType type)
contacts_filter_h filterHandle = null;
const char* pUri = GetUriFromType(type);
- _AddressbookUtil::InitContactViews();
+ SysTryReturnVoidResult(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
int ret = contacts_filter_create(pUri, &filterHandle);
SysTryReturnVoidResult(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, "[%s ] Memory allocation failed.", GetErrorMessage(GetLastResult()));
diff --git a/src/FScl_AddressbookUtil.h b/src/FScl_AddressbookUtil.h
index cff8e99..8a7b628 100644
--- a/src/FScl_AddressbookUtil.h
+++ b/src/FScl_AddressbookUtil.h
@@ -25,7 +25,6 @@
#include <unique_ptr.h>
#include <contacts.h>
#include <FBaseColArrayList.h>
-#include <FBaseColArrayListT.h>
#include <FBaseColAllElementsDeleter.h>
#include "FScl_ContactDbConnector.h"
@@ -583,16 +582,9 @@ public:
}
};
-extern "C" void ctsvc_view_uri_init();
-
class _AddressbookUtil
{
public:
- static void InitContactViews(void)
- {
- ctsvc_view_uri_init();
- }
-
template<typename __View>
static __SearchResult<__View>* ExecuteQuery(const __Query<__View>& query, int offset = 0, int limit = 0)
{
diff --git a/src/FScl_CategoryImpl.cpp b/src/FScl_CategoryImpl.cpp
index 4d880a0..53976cf 100644
--- a/src/FScl_CategoryImpl.cpp
+++ b/src/FScl_CategoryImpl.cpp
@@ -59,7 +59,7 @@ _CategoryImpl::_CategoryImpl(void)
int ret = CONTACTS_ERROR_NONE;
contacts_record_h recordHandle = null;
- _AddressbookUtil::InitContactViews();
+ SysTryReturnVoidResult(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
std::unique_ptr< ArrayListT<int> > pMembers (new (std::nothrow) ArrayListT<int>());
SysTryReturnVoidResult(NID_SCL, pMembers != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
@@ -101,7 +101,7 @@ _CategoryImpl::_CategoryImpl(const _CategoryImpl& rhs)
int ret = CONTACTS_ERROR_NONE;
contacts_record_h recordHandle = null;
- _AddressbookUtil::InitContactViews();
+ SysTryReturnVoidResult(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
std::unique_ptr< IListT<int> > pMembers (rhs.GetMembersN());
SysTryReturnVoidResult(NID_SCL, pMembers != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
@@ -556,7 +556,7 @@ _CategoryImpl::GetRemovedMembersN(void) const
result
_CategoryImpl::LoadMemberList(void)
{
- _AddressbookUtil::InitContactViews();
+ SysTryReturn(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
int intValue = 0;
result r = E_SUCCESS;
diff --git a/src/FScl_ContactImpl.cpp b/src/FScl_ContactImpl.cpp
index 9b272d0..7f59e6d 100644
--- a/src/FScl_ContactImpl.cpp
+++ b/src/FScl_ContactImpl.cpp
@@ -103,7 +103,7 @@ _ContactImpl::_ContactImpl(void)
{
contacts_record_h contactHandle = null;
- _AddressbookUtil::InitContactViews();
+ SysTryReturnVoidResult(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
int ret = contacts_record_create(_contacts_contact._uri, &contactHandle);
SysTryReturnVoidResult(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
@@ -116,7 +116,7 @@ _ContactImpl::_ContactImpl(const _ContactImpl& rhs)
{
contacts_record_h contactHandle = null;
- _AddressbookUtil::InitContactViews();
+ SysTryReturnVoidResult(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
int ret = contacts_record_clone(rhs.__contactHandle, &contactHandle);
SysTryReturnVoidResult(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
diff --git a/src/FScl_UserProfileImpl.cpp b/src/FScl_UserProfileImpl.cpp
index a3a5e2e..c0a3083 100644
--- a/src/FScl_UserProfileImpl.cpp
+++ b/src/FScl_UserProfileImpl.cpp
@@ -76,7 +76,7 @@ _UserProfileImpl::_UserProfileImpl(void)
{
contacts_record_h profileHandle = null;
- _AddressbookUtil::InitContactViews();
+ SysTryReturnVoidResult(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
int ret = contacts_record_create(_contacts_my_profile._uri, &profileHandle);
SysTryReturnVoidResult(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
@@ -89,7 +89,7 @@ _UserProfileImpl::_UserProfileImpl(const _UserProfileImpl& rhs)
{
contacts_record_h profileHandle = null;
- _AddressbookUtil::InitContactViews();
+ SysTryReturnVoidResult(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
int ret = contacts_record_clone(rhs.__profileHandle, &profileHandle);
SysTryReturnVoidResult(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));