From cdf5af5ba4c80c98cf4967ecf82ecac80ce3b854 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Mon, 10 Feb 2014 13:16:15 +1000 Subject: Test that the mapping manager engine pointer is still valid. QPointer holds a guarded pointer to a QObject. It must always be tested prior to use. Changed the parameter type to remove the need for the static_cast when setting the QPointer member. The root cause was that the tile fetcher object was not being destroyed when the mapping manager engine was. Which was because the two objects were in different threads. Some of the service specific tile fetchers were directly calling into the engine objects across thread. Gah. Since Qt 5 QNAM uses an application global thread for processing requests, there is no need to use threads in the tile fetcher. Change-Id: Id9df35ddfa78df2cbf334006fe5fc9726a75f92d Reviewed-by: Alex Blasche --- tests/auto/geotestplugin/qgeotilefetcher_test.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'tests/auto/geotestplugin/qgeotilefetcher_test.h') diff --git a/tests/auto/geotestplugin/qgeotilefetcher_test.h b/tests/auto/geotestplugin/qgeotilefetcher_test.h index 9c939b9d..71ae8601 100644 --- a/tests/auto/geotestplugin/qgeotilefetcher_test.h +++ b/tests/auto/geotestplugin/qgeotilefetcher_test.h @@ -78,16 +78,15 @@ class QGeoTileFetcherTest: public QGeoTileFetcher { Q_OBJECT public: - QGeoTileFetcherTest(QGeoTiledMappingManagerEngine *engine, QObject *parent = 0) - : QGeoTileFetcher(engine, parent), - finishRequestImmediately_(false), - mappingReply_(0), - errorCode_(QGeoTiledMapReply::NoError) {} + QGeoTileFetcherTest(QObject *parent = 0) + : QGeoTileFetcher(parent), finishRequestImmediately_(false), mappingReply_(0), + errorCode_(QGeoTiledMapReply::NoError) + { + } bool init() { - if (parameters_.contains("finishRequestImmediately")) - finishRequestImmediately_ = parameters_.value("finishRequestImmediately").toBool(); + return true; } @@ -132,7 +131,8 @@ public: void setParams(const QVariantMap ¶meters) { - parameters_ = parameters; + if (parameters.contains(QStringLiteral("finishRequestImmediately"))) + finishRequestImmediately_ = parameters.value(QStringLiteral("finishRequestImmediately")).toBool(); } void setTileSize(QSize tileSize) @@ -173,7 +173,6 @@ private: QBasicTimer timer_; QGeoTiledMapReply::Error errorCode_; QString errorString_; - QVariantMap parameters_; QSize tileSize_; }; -- cgit v1.2.1