summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/nokia/placesv2
diff options
context:
space:
mode:
authorabcd <amos.choy@nokia.com>2012-07-30 12:12:30 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-06 11:19:22 +0200
commit15be466da2709bb7f71b963edbacfc19d3a028e7 (patch)
tree63e2603001b415c60e9548903695f0235e215f43 /src/plugins/geoservices/nokia/placesv2
parent8568f4add64e070667e8255bb7b113d9e935e407 (diff)
downloadqtlocation-15be466da2709bb7f71b963edbacfc19d3a028e7.tar.gz
Fix incorrect error code during details fetch for nokia plugin
Previously a CommunicationError was returned if the id did not exist, this was because an incorrect id would result in a non-existent URL being used. Now we make the assumption if the URL content is not found, then it must be because the id did not exist. In such a case we can return a PlaceDoesNotExistError. Change-Id: Ibfc21b826e0514fd694cb69d0372ef99e46e768e Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'src/plugins/geoservices/nokia/placesv2')
-rw-r--r--src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.cpp5
-rw-r--r--src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.cpp b/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.cpp
index 5bfbe6cf..8eca2eb8 100644
--- a/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.cpp
+++ b/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.cpp
@@ -136,6 +136,11 @@ void QPlaceDetailsReplyImpl::replyFinished()
case QNetworkReply::OperationCanceledError:
setError(CancelError, "Request canceled.");
break;
+ case QNetworkReply::ContentNotFoundError:
+ setError(PlaceDoesNotExistError,
+ QString::fromLatin1("The id, %1, does not reference an existing place")
+ .arg(m_placeId));
+ break;
default:
setError(CommunicationError, "Network error.");
}
diff --git a/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.h b/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.h
index 58770316..f7a91162 100644
--- a/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.h
+++ b/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.h
@@ -66,6 +66,7 @@ public:
~QPlaceDetailsReplyImpl();
void abort();
+ void setPlaceId(const QString &placeId) { m_placeId = placeId; }
private slots:
void setError(QPlaceReply::Error error_, const QString &errorString);
@@ -74,6 +75,7 @@ private slots:
private:
QNetworkReply *m_reply;
QPlaceManagerEngineNokiaV2 *m_engine;
+ QString m_placeId;
};
QT_END_NAMESPACE