+ fix minor issue with url redirection
+ remove const reference
This commit is contained in:
@@ -116,9 +116,15 @@ QUrl DownloadManager::redirectUrl(const QUrl& url) const
|
||||
if (url.host() == QLatin1String("www.dropbox.com")) {
|
||||
QList< QPair<QString, QString> > query = url.queryItems();
|
||||
for (QList< QPair<QString, QString> >::iterator it = query.begin(); it != query.end(); ++it) {
|
||||
if (it->first == QLatin1String("dl") && it->second == QLatin1String("0\r\n")) {
|
||||
redirectUrl.removeQueryItem(QLatin1String("dl"));
|
||||
redirectUrl.addQueryItem(QLatin1String("dl"), QLatin1String("1\r\n"));
|
||||
if (it->first == QLatin1String("dl")) {
|
||||
if (it->second == QLatin1String("0\r\n")) {
|
||||
redirectUrl.removeQueryItem(QLatin1String("dl"));
|
||||
redirectUrl.addQueryItem(QLatin1String("dl"), QLatin1String("1\r\n"));
|
||||
}
|
||||
else if (it->second == QLatin1String("0")) {
|
||||
redirectUrl.removeQueryItem(QLatin1String("dl"));
|
||||
redirectUrl.addQueryItem(QLatin1String("dl"), QLatin1String("1"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user