summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2015-11-25 13:30:32 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2015-11-27 17:47:02 +0200
commit31fd2822f516337f084f85db7e369d0633113b73 (patch)
tree9ad07f1bc0b3924f225ecfc628955bbd683e1d99 /platform/android
parent4475f5486000bab8f1121f5cec6091bc04f165f1 (diff)
downloadqtlocation-mapboxgl-31fd2822f516337f084f85db7e369d0633113b73.tar.gz
[core] Replace time_t with std::chrono::seconds
Added aliases for std::chrono typedefs (eg. 'Seconds' for std::chrono::seconds). These aliases are used together with templated helper functions to replace time_t with std::chrono::seconds for most cases, in particular for 'modified' and 'expires' values in Response.
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/http_request_android.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/android/http_request_android.cpp b/platform/android/http_request_android.cpp
index 1c00c5ee5a..c4deb6d11e 100644
--- a/platform/android/http_request_android.cpp
+++ b/platform/android/http_request_android.cpp
@@ -129,8 +129,8 @@ HTTPAndroidRequest::HTTPAndroidRequest(HTTPAndroidContext* context_, const Resou
if (existingResponse) {
if (!existingResponse->etag.empty()) {
etagStr = existingResponse->etag;
- } else if (existingResponse->modified) {
- modifiedStr = util::rfc1123(existingResponse->modified);
+ } else if (existingResponse->modified != Seconds::zero()) {
+ modifiedStr = util::rfc1123(existingResponse->modified.count());
}
}
@@ -195,11 +195,11 @@ void HTTPAndroidRequest::onResponse(int code, std::string message, std::string e
response = std::make_unique<Response>();
using Error = Response::Error;
- response->modified = parse_date(modified.c_str());
+ response->modified = Seconds(parse_date(modified.c_str()));
response->etag = etag;
response->expires = parseCacheControl(cacheControl.c_str());
if (!expires.empty()) {
- response->expires = parse_date(expires.c_str());
+ response->expires = Seconds(parse_date(expires.c_str()));
}
response->data = std::make_shared<std::string>(body);