QT5 -- Enable build on 4.8.4 -OR- 5.2.0

New strategy to enable build on QT5 or QT4.8 is quite
simple to enact as most of the fixes for QT5 can be
applied to earlier releases.

This patch fixes up some of the special cases for QT5 so
they will continue to build on earlier releases.
This commit is contained in:
Mark Liversedge
2013-12-10 16:07:41 +00:00
parent 64c25192ee
commit e6ccd840f2
11 changed files with 108 additions and 24 deletions

View File

@@ -79,7 +79,11 @@ OAuthDialog::urlChanged(const QUrl &url)
QString code = url.toString().right(url.toString().length()-url.toString().indexOf("code=")-5);
QByteArray data;
#if QT_VERSION > 0x050000
QUrlQuery params;
#else
QUrl params;
#endif
QString urlstr = "";
if (site == STRAVA) {
@@ -104,7 +108,11 @@ OAuthDialog::urlChanged(const QUrl &url)
}
params.addQueryItem("code", code);
#if QT_VERSION > 0x050000
data.append(params.query(QUrl::FullyEncoded));
#else
data=params.encodedQuery();
#endif
QUrl url = QUrl(urlstr);
QNetworkRequest request = QNetworkRequest(url);