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>
This commit is contained in:
parent
a1b9d353e8
commit
dfddce5616
@ -22,6 +22,10 @@
|
|||||||
# include <unistd.h> // for dup(2)
|
# include <unistd.h> // for dup(2)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||||
|
# include <QUrlQuery>
|
||||||
|
#endif
|
||||||
|
|
||||||
struct dive_table gps_location_table;
|
struct dive_table gps_location_table;
|
||||||
static bool merge_locations_into_dives(void);
|
static bool merge_locations_into_dives(void);
|
||||||
|
|
||||||
@ -363,7 +367,13 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton* button)
|
|||||||
void SubsurfaceWebServices::startDownload()
|
void SubsurfaceWebServices::startDownload()
|
||||||
{
|
{
|
||||||
QUrl url("http://api.hohndel.org/api/dive/get/");
|
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());
|
url.addQueryItem("login", ui.userID->text().toUpper());
|
||||||
|
#else
|
||||||
|
QUrlQuery query;
|
||||||
|
query.addQueryItem("login", ui.userID->text().toUpper());
|
||||||
|
url.setQuery(query);
|
||||||
|
#endif
|
||||||
|
|
||||||
QNetworkRequest request;
|
QNetworkRequest request;
|
||||||
request.setUrl(url);
|
request.setUrl(url);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user