+ fix minor issue with url redirection

+ remove const reference
This commit is contained in:
wmayer 2016-03-14 18:02:24 +01:00
parent fadf2dbc3b
commit 4f92f5cbbb
2 changed files with 10 additions and 4 deletions

View File

@ -685,7 +685,7 @@ void CallTipsList::callTipItemActivated(QListWidgetItem *item)
cursor.insertText( text );
// get CallTip from item's UserRole-data
const CallTip &callTip = item->data(Qt::UserRole).value<CallTip>();
CallTip callTip = item->data(Qt::UserRole).value<CallTip>();
// if call completion enabled and we've something callable (method or class constructor) ...
if (this->doCallCompletion

View File

@ -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;
}
}