int WebOsCalendarSyncSource::deleteItem(SyncItem &item) { int ret = STC_COMMAND_FAILED; LOG.info("deleteItem called with %s data. And Type %s.",item.getKey(),item.getDataType()); LOG.info("Calling deleteEvent."); std::vector<WString> result = BlockingServiceCall("deleteEvent",item.getKey()); if(result.empty()) { LOG.error("delete event %s did not work.",item.getKey()); ret = STC_COMMAND_FAILED; } else { LOG.error("delete event was successful, received: %s.",result[0].c_str()); ret = STC_OK; } if (isErrorCode(ret)) { report->setLastErrorCode(ERR_ITEM_ERROR); report->setLastErrorMsg(ERRMSG_ITEM_ERROR); report->setState(SOURCE_ERROR); LOG.debug("Error deleting item: %", item.getKey()); } return ret; }
QString AbstractSyncSource::toString(SyncItem& item) { QByteArray data((char *)item.getData()); QString ret("Key: "); ret += item.getKey(); ret += " Mod.Time: "; ret += QString::number(item.getModificationTime()); ret += " Encoding: "; ret += item.getDataEncoding(); ret += " Size: "; ret += QString::number(item.getDataSize()); ret += " Type: "; ret += item.getDataType(); ret += " State: "; ret += QString::number(item.getState()); ret += " Data:\n"; ret += data; return ret; }