diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-25 20:57:48 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-25 22:09:07 +0200 |
commit | 0998ffbab8fee4a6e31a5293d239116dbe10449a (patch) | |
tree | 2c3058809a9bc53cf710d0afa727b285e3c96efe /platform/default | |
parent | d4db3b11267d9ac22fc53991a383f95f95e607ea (diff) | |
download | qtlocation-mapboxgl-0998ffbab8fee4a6e31a5293d239116dbe10449a.tar.gz |
[core] Use const& for the OfflineRegion object
It is used as const and also fixes a build issue on iOS:
```
Non-const lvalue reference to type ‘mbgl::OfflineRegion’ cannot bind
to a temporary of type ‘typename remove_reference<OfflineRegion &>::type’
(aka ‘mbgl::OfflineRegion’)
```
Diffstat (limited to 'platform/default')
-rw-r--r-- | platform/default/src/mbgl/storage/database_file_source.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/platform/default/src/mbgl/storage/database_file_source.cpp b/platform/default/src/mbgl/storage/database_file_source.cpp index 4dff99b5b8..50c444274e 100644 --- a/platform/default/src/mbgl/storage/database_file_source.cpp +++ b/platform/default/src/mbgl/storage/database_file_source.cpp @@ -248,26 +248,28 @@ void DatabaseFileSource::updateOfflineMetadata( impl->actor().invoke(&DatabaseFileSourceThread::updateMetadata, regionID, metadata, std::move(callback)); } -void DatabaseFileSource::deleteOfflineRegion(OfflineRegion& region, std::function<void(std::exception_ptr)> callback) { +void DatabaseFileSource::deleteOfflineRegion(const OfflineRegion& region, + std::function<void(std::exception_ptr)> callback) { impl->actor().invoke(&DatabaseFileSourceThread::deleteRegion, region, std::move(callback)); } -void DatabaseFileSource::invalidateOfflineRegion(OfflineRegion& region, +void DatabaseFileSource::invalidateOfflineRegion(const OfflineRegion& region, std::function<void(std::exception_ptr)> callback) { impl->actor().invoke(&DatabaseFileSourceThread::invalidateRegion, region.getID(), std::move(callback)); } -void DatabaseFileSource::setOfflineRegionObserver(OfflineRegion& region, +void DatabaseFileSource::setOfflineRegionObserver(const OfflineRegion& region, std::unique_ptr<OfflineRegionObserver> observer) { impl->actor().invoke(&DatabaseFileSourceThread::setRegionObserver, region.getID(), std::move(observer)); } -void DatabaseFileSource::setOfflineRegionDownloadState(OfflineRegion& region, OfflineRegionDownloadState state) { +void DatabaseFileSource::setOfflineRegionDownloadState(const OfflineRegion& region, OfflineRegionDownloadState state) { impl->actor().invoke(&DatabaseFileSourceThread::setRegionDownloadState, region.getID(), state); } void DatabaseFileSource::getOfflineRegionStatus( - OfflineRegion& region, std::function<void(expected<OfflineRegionStatus, std::exception_ptr>)> callback) const { + const OfflineRegion& region, + std::function<void(expected<OfflineRegionStatus, std::exception_ptr>)> callback) const { impl->actor().invoke(&DatabaseFileSourceThread::getRegionStatus, region.getID(), std::move(callback)); } |