Changeset View
Changeset View
Standalone View
Standalone View
src/common/davitemslistjob.cpp
Show First 20 Lines • Show All 214 Lines • ▼ Show 20 Line(s) | 182 | while (!responseElement.isNull()) { | |||
---|---|---|---|---|---|
215 | // ... if not it is an item | 215 | // ... if not it is an item | ||
216 | DavItem item; | 216 | DavItem item; | ||
217 | item.setContentType(itemsMimeType); | 217 | item.setContentType(itemsMimeType); | ||
218 | 218 | | |||
219 | // extract path | 219 | // extract path | ||
220 | const QDomElement hrefElement = Utils::firstChildElementNS(responseElement, QStringLiteral("DAV:"), QStringLiteral("href")); | 220 | const QDomElement hrefElement = Utils::firstChildElementNS(responseElement, QStringLiteral("DAV:"), QStringLiteral("href")); | ||
221 | const QString href = hrefElement.text(); | 221 | const QString href = hrefElement.text(); | ||
222 | 222 | | |||
223 | QUrl url = davJob->url(); | 223 | QUrl url = QUrl::fromUserInput(href); | ||
224 | url.setUserInfo(QString()); | 224 | url.setUserInfo(QString()); | ||
225 | if (href.startsWith(QLatin1Char('/'))) { | 225 | if (href.startsWith(QLatin1Char('/'))) { | ||
226 | // href is only a path, use request url to complete | 226 | // href is a relative URL (i.e. missing scheme, hostname and so on) | ||
227 | url.setPath(href, QUrl::TolerantMode); | 227 | // QUrl would treat this as a file URL be default, avoid that by setting | ||
228 | } else { | 228 | // empty scheme. | ||
229 | // href is a complete url | 229 | // Note: We don't want to expand this into a full URL (including hostname) | ||
230 | url = QUrl::fromUserInput(href); | 230 | // as some CalDav implementations don't seem to handle that correctly. | ||
231 | url.setScheme(QString()); | ||||
231 | } | 232 | } | ||
232 | 233 | | |||
233 | QString itemUrl = url.toDisplayString(); | 234 | QString itemUrl = url.toDisplayString(); | ||
234 | if (d->mSeenUrls.contains(itemUrl)) { | 235 | if (d->mSeenUrls.contains(itemUrl)) { | ||
235 | responseElement = Utils::nextSiblingElementNS(responseElement, QStringLiteral("DAV:"), QStringLiteral("response")); | 236 | responseElement = Utils::nextSiblingElementNS(responseElement, QStringLiteral("DAV:"), QStringLiteral("response")); | ||
236 | continue; | 237 | continue; | ||
237 | } | 238 | } | ||
238 | 239 | | |||
Show All 29 Lines |