summaryrefslogtreecommitdiffstats
path: root/src/plugins/geoservices/osm/qgeomapreplyosm.h
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2016-09-14 16:28:38 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2016-11-29 10:52:47 +0000
commit0a552f285fdc3760d9755109ceef3b87392a308d (patch)
tree943e169f0c002d8e9f74badd0f3ad7a452229e4d /src/plugins/geoservices/osm/qgeomapreplyosm.h
parent9b76e151b897698e285e4e39158b5934dc498bd1 (diff)
Refactoring: removing m_reply from GeoReply classes
This patch tries to simplify the code removing the contained m_reply from all the Geo[Map,Route,Geocode,Places]Reply classes. The need for m_reply was associated to the "abort" method, but this can be solved by emitting a signal in the superclass abort() method, and connecting that to QNetworkReply::abort() in the constructor. Since QNetworkReplyHttpImpl always sends an OperationCanceledError it should then be safe to call deleteLater() on the network reply in the slot connected to QNetworkReply::error This patch also prevents the series of "QCoreApplication::postEvent: Unexpected null receiver" warnings that are generated due to deletingLater already deleted objects (abort() emits an error, the reply is destroyed inside the onError slot, but also in the abort() method). Finally, this patch removes the setFinished() call in QGeoRouteReply::abort() since the documentation does not mention this, and all the subclasses do not perform this operation and emit the corresponding signal. tst_qgeoroutereply has been adapted accordingly. Change-Id: I226ee163e7bed784dd7f0da1522e651459543bca Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/plugins/geoservices/osm/qgeomapreplyosm.h')
-rw-r--r--src/plugins/geoservices/osm/qgeomapreplyosm.h11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/plugins/geoservices/osm/qgeomapreplyosm.h b/src/plugins/geoservices/osm/qgeomapreplyosm.h
index 804a0a24..ef0cbb15 100644
--- a/src/plugins/geoservices/osm/qgeomapreplyosm.h
+++ b/src/plugins/geoservices/osm/qgeomapreplyosm.h
@@ -40,12 +40,8 @@
#ifndef QGEOMAPREPLYOSM_H
#define QGEOMAPREPLYOSM_H
-#include "qgeotilefetcherosm.h"
-#include "qgeotileproviderosm.h"
-
#include <QtNetwork/QNetworkReply>
#include <QtLocation/private/qgeotiledmapreply_p.h>
-#include <QtCore/qpointer.h>
QT_BEGIN_NAMESPACE
@@ -57,16 +53,9 @@ public:
QGeoMapReplyOsm(QNetworkReply *reply, const QGeoTileSpec &spec, const QString &imageFormat, QObject *parent = 0);
~QGeoMapReplyOsm();
- void abort();
-
- QNetworkReply *networkReply() const;
-
private Q_SLOTS:
void networkReplyFinished();
void networkReplyError(QNetworkReply::NetworkError error);
-
-private:
- QPointer<QNetworkReply> m_reply;
};
QT_END_NAMESPACE