1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Mladen Pejaković 2012-02-15 17:11:36 +01:00
commit fb5f2b605e

View File

@ -238,11 +238,14 @@ QString DownloadFileHelper::getFileName(QNetworkReply* reply)
reg.indexIn(value); reg.indexIn(value);
path = QUrl::fromPercentEncoding(reg.cap(1).toUtf8()).trimmed(); path = QUrl::fromPercentEncoding(reg.cap(1).toUtf8()).trimmed();
} }
else if (value.contains("filename=\"")) { else if (value.contains("filename=")) {
QRegExp reg("filename=\"(.*)\""); QRegExp reg("filename=([^;]*)");
reg.setMinimal(true);
reg.indexIn(value); reg.indexIn(value);
path = reg.cap(1).trimmed(); path = reg.cap(1).trimmed();
if (path.startsWith("\"") && path.endsWith("\"")) {
path = path.mid(1, path.length() - 2);
}
} }
} }
if (path.isEmpty()) { if (path.isEmpty()) {