From 4f92f5cbbb2c5b3a90dd53319afc79e3c063053e Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 14 Mar 2016 18:02:24 +0100 Subject: [PATCH] + fix minor issue with url redirection + remove const reference --- src/Gui/CallTips.cpp | 2 +- src/Gui/DownloadManager.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Gui/CallTips.cpp b/src/Gui/CallTips.cpp index 0e2af1c8d631..d1b5565dc941 100644 --- a/src/Gui/CallTips.cpp +++ b/src/Gui/CallTips.cpp @@ -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 = item->data(Qt::UserRole).value(); // if call completion enabled and we've something callable (method or class constructor) ... if (this->doCallCompletion diff --git a/src/Gui/DownloadManager.cpp b/src/Gui/DownloadManager.cpp index cdf1a09ee2ab..9fa5b046cdc7 100644 --- a/src/Gui/DownloadManager.cpp +++ b/src/Gui/DownloadManager.cpp @@ -116,9 +116,15 @@ QUrl DownloadManager::redirectUrl(const QUrl& url) const if (url.host() == QLatin1String("www.dropbox.com")) { QList< QPair > query = url.queryItems(); for (QList< QPair >::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; } }