Changeset View
Changeset View
Standalone View
Standalone View
src/latitude/locationfetchjob.cpp
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | |||||
82 | void LocationFetchJob::start() | 82 | void LocationFetchJob::start() | ||
83 | { | 83 | { | ||
84 | QUrl url; | 84 | QUrl url; | ||
85 | if (d->timestamp == -1) { | 85 | if (d->timestamp == -1) { | ||
86 | url = LatitudeService::retrieveCurrentLocationUrl(d->granularity); | 86 | url = LatitudeService::retrieveCurrentLocationUrl(d->granularity); | ||
87 | } else { | 87 | } else { | ||
88 | url = LatitudeService::retrieveLocationUrl(d->timestamp, d->granularity); | 88 | url = LatitudeService::retrieveLocationUrl(d->timestamp, d->granularity); | ||
89 | } | 89 | } | ||
90 | QNetworkRequest request; | 90 | QNetworkRequest request(url); | ||
91 | request.setRawHeader("Authorization", "Bearer " + account()->accessToken().toLatin1()); | | |||
92 | request.setRawHeader("GData-Version", LatitudeService::APIVersion().toLatin1()); | 91 | request.setRawHeader("GData-Version", LatitudeService::APIVersion().toLatin1()); | ||
93 | request.setUrl(url); | | |||
94 | 92 | | |||
95 | enqueueRequest(request); | 93 | enqueueRequest(request); | ||
96 | } | 94 | } | ||
97 | 95 | | |||
98 | ObjectsList LocationFetchJob::handleReplyWithItems(const QNetworkReply *reply, const QByteArray& rawData) | 96 | ObjectsList LocationFetchJob::handleReplyWithItems(const QNetworkReply *reply, const QByteArray& rawData) | ||
99 | { | 97 | { | ||
100 | const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString(); | 98 | const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString(); | ||
101 | ContentType ct = Utils::stringToContentType(contentType); | 99 | ContentType ct = Utils::stringToContentType(contentType); | ||
Show All 13 Lines |