void IncidenceConverter::setItemDescription(KCal::Incidence *incidence,
        ngwt__CalendarItem *item)
{
    if(!incidence->description().isEmpty())
    {
        ngwt__MessageBody *message = soap_new_ngwt__MessageBody(soap(), -1);
        message->part =
            *soap_new_std__vectorTemplateOfPointerTongwt__MessagePart(soap(), -1);

        ngwt__MessagePart *part = soap_new_ngwt__MessagePart(soap(), -1);

        xsd__base64Binary data;
        data.__ptr =
            (unsigned char *)qStringToChar(incidence->description().utf8());
        data.__size = incidence->description().utf8().length();

        part->id = 0;
        part->__item = data;
        part->contentId = 0;
        std::string *str = soap_new_std__string(soap(), -1);
        str->append("text/plain");
        part->contentType = str;

        part->length = 0; // this is optional and sending the actual length of the source string truncates the data.
        part->offset = 0; // optional
        message->part.push_back(part);

        item->message = message;
    }
    else
        item->message = 0;
}
Exemple #2
0
char *GWConverter::qDateTimeToChar( const QDateTime &dt )
{
  return qStringToChar( dt.toString( "yyyyMMddThhmmZ" ) );
}
Exemple #3
0
char* GWConverter::qDateToChar( const QDate &date )
{
  return qStringToChar( date.toString( "yyyyMMdd" ) );
}