diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-01-15 09:30:34 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-15 15:49:44 +0700 |
commit | 2ebe03ab4042d2962e63e3d4f9a7bc714452e173 (patch) | |
tree | c879bd2585f3f19083ee82464b598662903a6ba8 /qt-ui | |
parent | 1363e28f8bcfb96913e24f12f29b1e3b94ab581a (diff) | |
download | subsurface-2ebe03ab4042d2962e63e3d4f9a7bc714452e173.tar.gz |
Port this code to work with Qt5
This code had parts that where Qt5-compatible, this introduces the last
bits that it needs to be completely compatible.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 6a94393f5..583000ff0 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -22,6 +22,10 @@ # include <unistd.h> // for dup(2) #endif +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +# include <QUrlQuery> +#endif + struct dive_table gps_location_table; static bool merge_locations_into_dives(void); @@ -369,7 +373,13 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton* button) void SubsurfaceWebServices::startDownload() { QUrl url("http://api.hohndel.org/api/dive/get/"); +#if QT_VERSION < QT_VERSION_CHECK(5,0,0) url.addQueryItem("login", ui.userID->text().toUpper()); +#else + QUrlQuery query; + query.addQueryItem("login", ui.userID->text().toUpper()); + url.setQuery(query); +#endif QNetworkRequest request; request.setUrl(url); |