diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2016-09-14 16:28:38 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2016-11-29 10:52:47 +0000 |
commit | 0a552f285fdc3760d9755109ceef3b87392a308d (patch) | |
tree | 943e169f0c002d8e9f74badd0f3ad7a452229e4d /tests/auto/geotestplugin | |
parent | 9b76e151b897698e285e4e39158b5934dc498bd1 (diff) | |
download | qtlocation-0a552f285fdc3760d9755109ceef3b87392a308d.tar.gz |
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 'tests/auto/geotestplugin')
-rw-r--r-- | tests/auto/geotestplugin/qgeocodingmanagerengine_test.h | 5 | ||||
-rw-r--r-- | tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h | 6 |
2 files changed, 0 insertions, 11 deletions
diff --git a/tests/auto/geotestplugin/qgeocodingmanagerengine_test.h b/tests/auto/geotestplugin/qgeocodingmanagerengine_test.h index 1d9f0792..ecbb60d1 100644 --- a/tests/auto/geotestplugin/qgeocodingmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeocodingmanagerengine_test.h @@ -57,11 +57,6 @@ public: void callSetOffset ( int offset ) {setOffset(offset);} void callSetLocations ( const QList<QGeoLocation> & locations ) {setLocations(locations);} void callSetViewport ( const QGeoShape &viewport ) {setViewport(viewport);} - void abort() { - emit aborted(); - } -Q_SIGNALS: - void aborted(); }; class QGeoCodingManagerEngineTest: public QGeoCodingManagerEngine diff --git a/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h b/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h index 8ae58042..0a1e7ce6 100644 --- a/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h @@ -52,12 +52,6 @@ public: void callSetError ( Error error, const QString & errorString ) {setError(error, errorString);} void callSetFinished ( bool finished ) {setFinished(finished);} void callSetRoutes(const QList<QGeoRoute> &routes) {setRoutes(routes);} - - void abort() { - emit aborted(); - } -Q_SIGNALS: - void aborted(); }; class QGeoRoutingManagerEngineTest: public QGeoRoutingManagerEngine |