Changeset View
Changeset View
Standalone View
Standalone View
src/common/davcollectionsfetchjob.cpp
Show First 20 Lines • Show All 297 Lines • ▼ Show 20 Line(s) | 234 | while (!responseElement.isNull()) { | |||
---|---|---|---|---|---|
298 | } | 298 | } | ||
299 | 299 | | |||
300 | // extract calendar color if provided | 300 | // extract calendar color if provided | ||
301 | const QDomElement colorElement = Utils::firstChildElementNS(propElement, QStringLiteral("http://apple.com/ns/ical/"), QStringLiteral("calendar-color")); | 301 | const QDomElement colorElement = Utils::firstChildElementNS(propElement, QStringLiteral("http://apple.com/ns/ical/"), QStringLiteral("calendar-color")); | ||
302 | QColor color; | 302 | QColor color; | ||
303 | if (!colorElement.isNull()) { | 303 | if (!colorElement.isNull()) { | ||
304 | QString colorValue = colorElement.text(); | 304 | QString colorValue = colorElement.text(); | ||
305 | if (QColor::isValidColor(colorValue)) { | 305 | if (QColor::isValidColor(colorValue)) { | ||
306 | // Color is either #RRGGBBAA or #RRGGBB but QColor expects #AARRGGBB | ||||
307 | // so we put the AA in front if the string's length is 9. | ||||
308 | if (colorValue.size() == 9) { | ||||
309 | QString fixedColorValue = QStringLiteral("#") + colorValue.mid(7, 2) + colorValue.mid(1, 6); | ||||
310 | color.setNamedColor(fixedColorValue); | ||||
311 | } else { | ||||
306 | color.setNamedColor(colorValue); | 312 | color.setNamedColor(colorValue); | ||
307 | } | 313 | } | ||
308 | } | 314 | } | ||
315 | } | ||||
309 | 316 | | |||
310 | // extract allowed content types | 317 | // extract allowed content types | ||
311 | const DavCollection::ContentTypes contentTypes = DavManager::self()->davProtocol(mUrl.protocol())->collectionContentTypes(propstatElement); | 318 | const DavCollection::ContentTypes contentTypes = DavManager::self()->davProtocol(mUrl.protocol())->collectionContentTypes(propstatElement); | ||
312 | 319 | | |||
313 | auto _url = url; | 320 | auto _url = url; | ||
314 | _url.setUserInfo(mUrl.url().userInfo()); | 321 | _url.setUserInfo(mUrl.url().userInfo()); | ||
315 | DavCollection collection(DavUrl(_url, mUrl.protocol()), displayName, contentTypes); | 322 | DavCollection collection(DavUrl(_url, mUrl.protocol()), displayName, contentTypes); | ||
316 | 323 | | |||
Show All 33 Lines |