return g_variant_builder_end(&builder);
}
-static GVariant *_projection_to_gvariant(cal_query_s *p)
+static GVariant *_projection_to_gvariant(cal_query_s *q)
{
int i;
GVariantBuilder builder;
g_variant_builder_init(&builder, G_VARIANT_TYPE("au"));
- for (i = 0; i < p->projection_count; i++)
- g_variant_builder_add(&builder, "u", p->projection[i]);
+ for (i = 0; i < q->projection_count; i++)
+ g_variant_builder_add(&builder, "u", q->projection[i]);
return g_variant_builder_end(&builder);
}
GVariantIter *iter_projection = NULL;
g_variant_get(arg_projection, "au", &iter_projection);
- int i = 0;
q->projection = calloc(count_projection, sizeof(unsigned int));
if (NULL == q->projection) {
ERR("calloc() Fail");
return CALENDAR_ERROR_OUT_OF_MEMORY;
}
- while (g_variant_iter_loop(iter_projection, "u", &q->projection[i]))
- i++;
+ int i = 0;
+ for (i = 0; i < count_projection; i++)
+ g_variant_iter_loop(iter_projection, "u", &q->projection[i]);
q->projection_count = count_projection;
event->range_type = sqlite3_column_int(stmt, *stmt_count);
break;
case CAL_PROPERTY_EVENT_UNTIL:
+ event->until.type = sqlite3_column_int(stmt, *stmt_count);
+ if (event->until.type == CALENDAR_TIME_UTIME) {
+ *stmt_count = *stmt_count+1;
+ event->until.time.utime = sqlite3_column_int64(stmt, *stmt_count);
+ *stmt_count = *stmt_count+1; /* until_datetime */
+ } else {
+ *stmt_count = *stmt_count+1;
+ *stmt_count = *stmt_count+1;
+ temp = sqlite3_column_text(stmt, *stmt_count);
+ if (temp) {
+ sscanf((const char *)temp, CAL_FORMAT_LOCAL_DATETIME, &(event->until.time.date.year),
+ &(event->until.time.date.month), &(event->until.time.date.mday),
+ &(event->until.time.date.hour), &(event->until.time.date.minute),
+ &(event->until.time.date.second));
+ }
+ }
break;
case CAL_PROPERTY_EVENT_COUNT:
event->count = sqlite3_column_int(stmt, *stmt_count);
case CAL_PROPERTY_EVENT_CALENDAR_SYSTEM_TYPE:
event->system_type = sqlite3_column_int(stmt, *stmt_count);
break;
+ case CAL_PROPERTY_EVENT_IS_ALLDAY:
+ event->is_allday = sqlite3_column_int(stmt, *stmt_count);
+ break;
default:
- sqlite3_column_int(stmt, *stmt_count);
+ ERR("invalid (0x%x)", property);
break;
}
timezone->calendar_id = sqlite3_column_int(stmt, stmt_count);
break;
default:
- sqlite3_column_int(stmt, stmt_count);
+ ERR("Invalid property(0x%x)", property);
break;
}
todo->range_type = sqlite3_column_int(stmt, *stmt_count);
break;
case CAL_PROPERTY_TODO_UNTIL:
+ todo->until.type = sqlite3_column_int(stmt, *stmt_count);
+ if (todo->until.type == CALENDAR_TIME_UTIME) {
+ *stmt_count = *stmt_count+1;
+ todo->until.time.utime = sqlite3_column_int64(stmt, *stmt_count);
+ *stmt_count = *stmt_count+1; /* until_datetime */
+ } else {
+ *stmt_count = *stmt_count+1;
+ *stmt_count = *stmt_count+1;
+ temp = sqlite3_column_text(stmt, *stmt_count);
+ if (temp) {
+ sscanf((const char *)temp, CAL_FORMAT_LOCAL_DATETIME, &(todo->until.time.date.year),
+ &(todo->until.time.date.month), &(todo->until.time.date.mday),
+ &(todo->until.time.date.hour), &(todo->until.time.date.minute),
+ &(todo->until.time.date.second));
+ }
+ }
break;
case CAL_PROPERTY_TODO_COUNT:
todo->count = sqlite3_column_int(stmt, *stmt_count);
sqlite3_finalize(stmt);
return CALENDAR_ERROR_NONE;
}
+ sqlite3_finalize(stmt);
switch (ret) {
case SQLITE_DONE: