Changeset View
Changeset View
Standalone View
Standalone View
resources/kolab/pimkolab/icalendar/icalendar.cpp
Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Line(s) | 126 | // e->recurrence()->addRDateTime(e->dtStart()); //FIXME The createScheduleMessage converts everything to utc without a recurrence. | |||
---|---|---|---|---|---|
128 | format.setApplication(QStringLiteral("libkolab"), QStringLiteral(LIBKOLAB_LIB_VERSION_STRING)); | 128 | format.setApplication(QStringLiteral("libkolab"), QStringLiteral(LIBKOLAB_LIB_VERSION_STRING)); | ||
129 | KCalCore::iTIPMethod method = mapToKCalCore(m); | 129 | KCalCore::iTIPMethod method = mapToKCalCore(m); | ||
130 | const QString &messageText = format.createScheduleMessage(e, method); | 130 | const QString &messageText = format.createScheduleMessage(e, method); | ||
131 | //This code is mostly from MailScheduler::performTransaction | 131 | //This code is mostly from MailScheduler::performTransaction | ||
132 | if (method == KCalCore::iTIPRequest | 132 | if (method == KCalCore::iTIPRequest | ||
133 | || method == KCalCore::iTIPCancel | 133 | || method == KCalCore::iTIPCancel | ||
134 | || method == KCalCore::iTIPAdd | 134 | || method == KCalCore::iTIPAdd | ||
135 | || method == KCalCore::iTIPDeclineCounter) { | 135 | || method == KCalCore::iTIPDeclineCounter) { | ||
136 | return Conversion::toStdString(QString(mailAttendees(e, bccMe, messageText))); | 136 | return Conversion::toStdString(QString::fromUtf8(mailAttendees(e, bccMe, messageText))); | ||
137 | } else { | 137 | } else { | ||
138 | QString subject; | 138 | QString subject; | ||
139 | if (e && method == KCalCore::iTIPCounter) { | 139 | if (e && method == KCalCore::iTIPCounter) { | ||
140 | subject = i18n("Counter proposal: %1", e->summary()); | 140 | subject = i18n("Counter proposal: %1", e->summary()); | ||
141 | } | 141 | } | ||
142 | return Conversion::toStdString(QString(mailOrganizer(e, Conversion::fromStdString(from), bccMe, messageText, subject))); | 142 | return Conversion::toStdString(QString::fromUtf8(mailOrganizer(e, Conversion::fromStdString(from), bccMe, messageText, subject))); | ||
143 | } | 143 | } | ||
144 | } | 144 | } | ||
145 | 145 | | |||
146 | std::vector< Event > ITipHandler::fromIMip(const std::string &input) | 146 | std::vector< Event > ITipHandler::fromIMip(const std::string &input) | ||
147 | { | 147 | { | ||
148 | KMime::Message::Ptr msg = KMime::Message::Ptr(new KMime::Message); | 148 | KMime::Message::Ptr msg = KMime::Message::Ptr(new KMime::Message); | ||
149 | msg->setContent(Conversion::fromStdString(input).toUtf8()); | 149 | msg->setContent(Conversion::fromStdString(input).toUtf8()); | ||
150 | msg->parse(); | 150 | msg->parse(); | ||
151 | msg->content(KMime::ContentIndex()); | 151 | msg->content(KMime::ContentIndex()); | ||
152 | 152 | | |||
153 | KMime::Content *c = Kolab::Mime::findContentByType(msg, "text/calendar"); | 153 | KMime::Content *c = Kolab::Mime::findContentByType(msg, "text/calendar"); | ||
154 | if (!c) { | 154 | if (!c) { | ||
155 | qCWarning(PIMKOLAB_LOG) << "could not find text/calendar part"; | 155 | qCWarning(PIMKOLAB_LOG) << "could not find text/calendar part"; | ||
156 | return std::vector< Event >(); | 156 | return std::vector< Event >(); | ||
157 | } | 157 | } | ||
158 | return fromITip(Conversion::toStdString(QString(c->decodedContent()))); | 158 | return fromITip(Conversion::toStdString(QString::fromUtf8(c->decodedContent()))); | ||
159 | } | 159 | } | ||
160 | } | 160 | } |