modify terminology:calendar->book,allday->localtime,normal->utime,svc->service
[platform/core/pim/calendar-service.git] / server / db / cal_db_plugin_event.c
index c89e481..533af83 100644 (file)
@@ -63,7 +63,7 @@ static int _cal_db_event_exception_delete_with_id(int original_id);
 static int _cal_db_event_exception_get_ids(int original_id, GList **out_list);
 static int _cal_db_event_exception_update(cal_list_s *exception_list_s, int original_id, int calendar_id, int is_dirty_in_time, time_t time_diff, int old_type, int new_type);
 static int _cal_db_event_get_deleted_data(int id, int* calendar_book_id, int* created_ver, int* original_event_id, char** recurrence_id);
-static int _cal_db_event_exdate_insert_normal(int event_id, const char* original_exdate, const char* exdate, int **exception_id, int *exception_len);
+static int _cal_db_event_exdate_insert_utime(int event_id, const char* original_exdate, const char* exdate, int **exception_id, int *exception_len);
 static bool _cal_db_event_check_calendar_book_type(calendar_record_h record);
 
 static void __check_list(calendar_list_h l)
@@ -1134,10 +1134,10 @@ static int _cal_db_event_get_records_with_query(calendar_query_h query, int offs
 
        if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT)) {
                table_name = cal_strdup(CAL_VIEW_TABLE_EVENT);
-       } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR)) {
-               table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR);
-       } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE)) {
-               table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR_ATTENDEE);
+       } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_BOOK)) {
+               table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_BOOK);
+       } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_BOOK_ATTENDEE)) {
+               table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_BOOK_ATTENDEE);
        } else {
                /* LCOV_EXCL_START */
                ERR("uri(%s) not support get records with query", que->view_uri);
@@ -1375,10 +1375,10 @@ static int _cal_db_event_get_count_with_query(calendar_query_h query, int *out_c
 
        if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT)) {
                table_name = cal_strdup(CAL_VIEW_TABLE_EVENT);
-       } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR)) {
-               table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR);
-       } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE)) {
-               table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR_ATTENDEE);
+       } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_BOOK)) {
+               table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_BOOK);
+       } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_BOOK_ATTENDEE)) {
+               table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_BOOK_ATTENDEE);
        } else {
                /* LCOV_EXCL_START */
                ERR("uri(%s) not support get records with query", que->view_uri);
@@ -1898,7 +1898,7 @@ static void _cal_db_event_get_property_stmt(sqlite3_stmt *stmt,
        case CAL_PROPERTY_EVENT_ID:
                event->index = sqlite3_column_int(stmt, *stmt_count);
                break;
-       case CAL_PROPERTY_EVENT_CALENDAR_ID:
+       case CAL_PROPERTY_EVENT_BOOK_ID:
                event->calendar_id = sqlite3_column_int(stmt, *stmt_count);
                break;
        case CAL_PROPERTY_EVENT_SUMMARY:
@@ -2245,7 +2245,7 @@ static int _cal_db_event_update_dirty(calendar_record_h record, int is_dirty_in_
                        ret = calendar_record_get_str_p(record, property_info[i]. property_id, &record_exdate);
                        if (CALENDAR_ERROR_NONE != ret)
                                continue;
-                       ret = calendar_record_get_int(original_record, CAL_PROPERTY_EVENT_CALENDAR_ID, &calendar_id);
+                       ret = calendar_record_get_int(original_record, CAL_PROPERTY_EVENT_BOOK_ID, &calendar_id);
                        if (CALENDAR_ERROR_NONE != ret)
                                continue;
 
@@ -2261,14 +2261,14 @@ static int _cal_db_event_update_dirty(calendar_record_h record, int is_dirty_in_
                        if (CALENDAR_ERROR_NONE != ret)
                                continue;
                        if (sync_event_type == CALENDAR_BOOK_SYNC_EVENT_FOR_EVERY_AND_REMAIN) {
-                               ret = _cal_db_event_exdate_insert_normal(event_id, original_exdate,
+                               ret = _cal_db_event_exdate_insert_utime(event_id, original_exdate,
                                                record_exdate, NULL, NULL);
                                WARN_IF(CALENDAR_ERROR_NONE != ret, "%s->%s", original_exdate, record_exdate);
 
                        } else {
                                int *exception_ids = NULL;
                                int exception_len = 0;
-                               ret = _cal_db_event_exdate_insert_normal(event_id, original_exdate,
+                               ret = _cal_db_event_exdate_insert_utime(event_id, original_exdate,
                                                record_exdate, &exception_ids, &exception_len);
                                WARN_IF(CALENDAR_ERROR_NONE != ret, "%s->%s", original_exdate, record_exdate);
                                ret = _cal_db_event_delete_exception(exception_ids, exception_len);
@@ -2620,7 +2620,7 @@ static int _cal_db_event_get_deleted_data(int id, int* book_id, int* created_ver
        return CALENDAR_ERROR_NONE;
 }
 
-static int _cal_db_event_exdate_insert_normal(int event_id, const char* original_exdate,
+static int _cal_db_event_exdate_insert_utime(int event_id, const char* original_exdate,
                const char* exdate, int **exception_ids, int *exception_len)
 {
        int ret = CALENDAR_ERROR_NONE;