Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 90c1d9af authored by Laurent Montel's avatar Laurent Montel 😁

Revert "Use URLs in multiget requests as returned by the Server"

This reverts commit abfdd65f.

Revert this commit as it breaks for some users.

I revert it before 17.12 rc tag.

If we can fix it before 17.12 we will reactivate it
parent c7d8317f
......@@ -116,14 +116,13 @@ void DavItemsFetchJob::davJobFinished(KJob *job)
const QDomElement hrefElement = Utils::firstChildElementNS(responseElement, QStringLiteral("DAV:"), QStringLiteral("href"));
const QString href = hrefElement.text();
QUrl url = QUrl::fromUserInput(href);
QUrl url = davJob->url();
if (href.startsWith(QLatin1Char('/'))) {
// href is a relative URL (i.e. missing scheme, hostname and so on)
// QUrl would treat this as a file URL be default, avoid that by setting
// empty scheme.
// Note: We don't want to expand this into a full URL (including hostname)
// as some CalDav implementations don't seem to handle that correctly.
url.setScheme(QString());
// href is only a path, use request url to complete
url.setPath(href, QUrl::TolerantMode);
} else {
// href is a complete url
url = QUrl::fromUserInput(href);
}
auto _url = url;
......
......@@ -220,15 +220,14 @@ void DavItemsListJob::davJobFinished(KJob *job)
const QDomElement hrefElement = Utils::firstChildElementNS(responseElement, QStringLiteral("DAV:"), QStringLiteral("href"));
const QString href = hrefElement.text();
QUrl url = QUrl::fromUserInput(href);
QUrl url = davJob->url();
url.setUserInfo(QString());
if (href.startsWith(QLatin1Char('/'))) {
// href is a relative URL (i.e. missing scheme, hostname and so on)
// QUrl would treat this as a file URL be default, avoid that by setting
// empty scheme.
// Note: We don't want to expand this into a full URL (including hostname)
// as some CalDav implementations don't seem to handle that correctly.
url.setScheme(QString());
// href is only a path, use request url to complete
url.setPath(href, QUrl::TolerantMode);
} else {
// href is a complete url
url = QUrl::fromUserInput(href);
}
QString itemUrl = url.toDisplayString();
......
......@@ -271,7 +271,8 @@ public:
for (const QString &url : urls) {
QDomElement hrefElement = document.createElementNS(QStringLiteral("DAV:"), QStringLiteral("href"));
const QDomText textNode = document.createTextNode(url);
const QUrl pathUrl = QUrl::fromUserInput(url);
const QDomText textNode = document.createTextNode(pathUrl.toString());
hrefElement.appendChild(textNode);
multigetElement.appendChild(hrefElement);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment