remove build warning 60/148260/1 accepted/tizen/unified/20170911.060323 submit/tizen/20170908.053201
authorYoungjae Shin <yj99.shin@samsung.com>
Thu, 7 Sep 2017 08:03:17 +0000 (17:03 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Thu, 7 Sep 2017 08:03:17 +0000 (17:03 +0900)
Change-Id: I0f86c94f69ff40fc3403829fb2fb5c8aa5bc3eae

server/CMakeLists.txt
server/cal_server_account.c
server/cal_server_contacts.c

index a0386fa..abd8e7a 100644 (file)
@@ -49,7 +49,7 @@ ENDIF()
 
 ADD_EXECUTABLE(${DAEMON}-tv ${DAEMON_SRCS})
 ADD_DEPENDENCIES(${DAEMON}-tv GENERATED_DBUS_CODE)
-SET_TARGET_PROPERTIES(${DAEMON}-tv PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/without_contacts")
+SET_TARGET_PROPERTIES(${DAEMON}-tv PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/without_contacts -DTIZEN_FEATURE_NO_CONTACTS")
 TARGET_LINK_LIBRARIES(${DAEMON}-tv ${daemon_pkgs_LIBRARIES})
 
 IF(${TIZEN_PROFILE_TV} EQUAL 0)
index b014470..7f48962 100644 (file)
@@ -31,6 +31,7 @@
 static pthread_mutex_t cal_mutex_account = PTHREAD_MUTEX_INITIALIZER;
 static account_subscribe_h cal_account_h = NULL;
 
+#ifndef TIZEN_FEATURE_NO_CONTACTS
 static bool _noti_cb(const char* event_type, int account_id,
                void* user_data)
 {
@@ -42,6 +43,7 @@ static bool _noti_cb(const char* event_type, int account_id,
        }
        return true;
 }
+#endif
 
 int cal_server_account_init(void)
 {
index 7b31353..cc5887e 100644 (file)
@@ -256,7 +256,9 @@ static int cal_server_contacts_insert_event(int id, calendar_list_h out_insert)
 
        RETV_IF(NULL == out_insert, CALENDAR_ERROR_INVALID_PARAMETER);
 
+#ifndef TIZEN_FEATURE_NO_CONTACTS
        contacts_record_h contact = NULL;
+#endif
        ret = contacts_db_get_record(_contacts_contact._uri, id, &contact);
        if (CONTACTS_ERROR_NONE != ret) {
                /* LCOV_EXCL_START */
@@ -275,7 +277,9 @@ static int cal_server_contacts_insert_event(int id, calendar_list_h out_insert)
        }
        if (0 < address_book_id) { /* default phone addressbook is 0 */
                DBG("address_book_id(%d)", address_book_id);
+#ifndef TIZEN_FEATURE_NO_CONTACTS
                contacts_record_h address_book = NULL;
+#endif
                ret = contacts_db_get_record(_contacts_address_book._uri, address_book_id, &address_book);
                if (CONTACTS_ERROR_NONE != ret) {
                        /* LCOV_EXCL_START */
@@ -296,8 +300,10 @@ static int cal_server_contacts_insert_event(int id, calendar_list_h out_insert)
                DBG("account_id[%d]", account_id);
        }
 
+#ifndef TIZEN_FEATURE_NO_CONTACTS
        int index = 0;
        contacts_record_h contact_event = NULL;
+#endif
        while (CONTACTS_ERROR_NONE == contacts_record_get_child_record_at_p(contact,
                                _contacts_contact.event, index++, &contact_event)) {
                int type = 0;
@@ -369,7 +375,9 @@ static void _cal_server_contacts_get_event_list(contacts_list_h contacts_list,
        int count = 0;
        contacts_list_first(contacts_list);
        do {
+#ifndef TIZEN_FEATURE_NO_CONTACTS
                contacts_record_h updated = NULL;
+#endif
                contacts_list_get_current_record_p(contacts_list, &updated);
 
                int contact_id = 0;
@@ -659,11 +667,12 @@ void cal_server_contacts_delete(int account_id)
        calendar_query_destroy(query);
 }
 
+#ifndef TIZEN_FEATURE_NO_CONTACTS
 static void _changed_cb(const char* view_uri, void *user_data)
 {
        cal_server_contacts_start();
 }
-
+#endif
 static int cal_server_contacts_init(void)
 {
        int ret = 0;