summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/src/file_source.cpp7
-rw-r--r--platform/darwin/src/MGLOfflineStorage.mm2
-rw-r--r--platform/default/src/mbgl/storage/offline.cpp11
-rw-r--r--platform/default/src/mbgl/storage/offline_download.cpp2
-rw-r--r--platform/default/src/mbgl/storage/online_file_source.cpp14
-rw-r--r--platform/node/src/node_map.cpp2
-rw-r--r--platform/qt/include/qmapboxgl.hpp6
-rw-r--r--platform/qt/src/qmapboxgl.cpp11
8 files changed, 30 insertions, 25 deletions
diff --git a/platform/android/src/file_source.cpp b/platform/android/src/file_source.cpp
index 05b57e5d1c..5f61aadba0 100644
--- a/platform/android/src/file_source.cpp
+++ b/platform/android/src/file_source.cpp
@@ -58,14 +58,15 @@ void FileSource::setAPIBaseUrl(jni::JNIEnv& env, const jni::String& url) {
void FileSource::setResourceTransform(jni::JNIEnv& env, const jni::Object<FileSource::ResourceTransformCallback>& transformCallback) {
if (transformCallback) {
auto global = jni::NewGlobal<jni::EnvAttachingDeleter>(env, transformCallback);
- resourceTransform = std::make_unique<Actor<ResourceTransform>>(*Scheduler::GetCurrent(),
+ resourceTransform = std::make_unique<Actor<ResourceTransform>>(
+ *Scheduler::GetCurrent(),
// Capture the ResourceTransformCallback object as a managed global into
// the lambda. It is released automatically when we're setting a new ResourceTransform in
// a subsequent call.
// Note: we're converting it to shared_ptr because this lambda is converted to a std::function,
// which requires copyability of its captured variables.
- [callback = std::make_shared<decltype(global)>(std::move(global))]
- (mbgl::Resource::Kind kind, const std::string&& url_) {
+ [callback = std::make_shared<decltype(global)>(std::move(global))](mbgl::Resource::Kind kind,
+ const std::string& url_) {
android::UniqueEnv _env = android::AttachEnv();
return FileSource::ResourceTransformCallback::onURL(*_env, *callback, int(kind), url_);
});
diff --git a/platform/darwin/src/MGLOfflineStorage.mm b/platform/darwin/src/MGLOfflineStorage.mm
index 95fcebc42b..4de406a456 100644
--- a/platform/darwin/src/MGLOfflineStorage.mm
+++ b/platform/darwin/src/MGLOfflineStorage.mm
@@ -91,7 +91,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio
MGLLogDebug(@"Setting delegate: %@", newValue);
_delegate = newValue;
if ([self.delegate respondsToSelector:@selector(offlineStorage:URLForResourceOfKind:withURL:)]) {
- _mbglResourceTransform = std::make_unique<mbgl::Actor<mbgl::ResourceTransform>>(*mbgl::Scheduler::GetCurrent(), [offlineStorage = self](auto kind_, const std::string&& url_) -> std::string {
+ _mbglResourceTransform = std::make_unique<mbgl::Actor<mbgl::ResourceTransform>>(*mbgl::Scheduler::GetCurrent(), [offlineStorage = self](auto kind_, const std::string& url_) -> std::string {
NSURL* url =
[NSURL URLWithString:[[NSString alloc] initWithBytes:url_.data()
length:url_.length()
diff --git a/platform/default/src/mbgl/storage/offline.cpp b/platform/default/src/mbgl/storage/offline.cpp
index dd809ad129..795710585c 100644
--- a/platform/default/src/mbgl/storage/offline.cpp
+++ b/platform/default/src/mbgl/storage/offline.cpp
@@ -16,10 +16,14 @@ namespace mbgl {
// OfflineTilePyramidRegionDefinition
-OfflineTilePyramidRegionDefinition::OfflineTilePyramidRegionDefinition(
- std::string styleURL_, LatLngBounds bounds_, double minZoom_, double maxZoom_, float pixelRatio_, bool includeIdeographs_)
+OfflineTilePyramidRegionDefinition::OfflineTilePyramidRegionDefinition(std::string styleURL_,
+ LatLngBounds bounds_,
+ double minZoom_,
+ double maxZoom_,
+ float pixelRatio_,
+ bool includeIdeographs_)
: styleURL(std::move(styleURL_)),
- bounds(std::move(bounds_)),
+ bounds(bounds_),
minZoom(minZoom_),
maxZoom(maxZoom_),
pixelRatio(pixelRatio_),
@@ -30,7 +34,6 @@ OfflineTilePyramidRegionDefinition::OfflineTilePyramidRegionDefinition(
}
}
-
// OfflineGeometryRegionDefinition
OfflineGeometryRegionDefinition::OfflineGeometryRegionDefinition(std::string styleURL_, Geometry<double> geometry_, double minZoom_, double maxZoom_, float pixelRatio_, bool includeIdeographs_)
diff --git a/platform/default/src/mbgl/storage/offline_download.cpp b/platform/default/src/mbgl/storage/offline_download.cpp
index 939164bd35..d5cf7e4fe1 100644
--- a/platform/default/src/mbgl/storage/offline_download.cpp
+++ b/platform/default/src/mbgl/storage/offline_download.cpp
@@ -433,7 +433,7 @@ void OfflineDownload::ensureResource(Resource&& resource,
}
}
- if (result) resourcesToBeMarkedAsUsed.emplace_back(std::move(resource));
+ if (result) resourcesToBeMarkedAsUsed.emplace_back(resource);
return result;
};
diff --git a/platform/default/src/mbgl/storage/online_file_source.cpp b/platform/default/src/mbgl/storage/online_file_source.cpp
index 4e19d48a15..a8907d849b 100644
--- a/platform/default/src/mbgl/storage/online_file_source.cpp
+++ b/platform/default/src/mbgl/storage/online_file_source.cpp
@@ -78,10 +78,12 @@ public:
if (resourceTransform) {
// Request the ResourceTransform actor a new url and replace the resource url with the
// transformed one before proceeding to schedule the request.
- resourceTransform->invoke(&ResourceTransform::transform, request->resource.kind,
- std::move(request->resource.url), [ref = request->actor()](const std::string&& url) {
- ref.invoke(&OnlineFileRequest::setTransformedURL, std::move(url));
- });
+ resourceTransform->invoke(&ResourceTransform::transform,
+ request->resource.kind,
+ std::move(request->resource.url),
+ [ref = request->actor()](const std::string&& url) {
+ ref.invoke(&OnlineFileRequest::setTransformedURL, url);
+ });
} else {
request->schedule();
}
@@ -466,8 +468,8 @@ void OnlineFileRequest::networkIsReachableAgain() {
}
void OnlineFileRequest::setTransformedURL(const std::string&& url) {
- resource.url = std::move(url);
- schedule();
+ resource.url = url;
+ schedule();
}
ActorRef<OnlineFileRequest> OnlineFileRequest::actor() {
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp
index 7450f461f8..5ce201da2e 100644
--- a/platform/node/src/node_map.cpp
+++ b/platform/node/src/node_map.cpp
@@ -474,7 +474,7 @@ void NodeMap::startRender(NodeMap::RenderOptions options) {
map->renderStill(camera, options.debugOptions, [this](const std::exception_ptr eptr) {
if (eptr) {
- error = std::move(eptr);
+ error = eptr;
uv_async_send(async);
} else {
assert(!image.data);
diff --git a/platform/qt/include/qmapboxgl.hpp b/platform/qt/include/qmapboxgl.hpp
index e83be37511..7441b1aa18 100644
--- a/platform/qt/include/qmapboxgl.hpp
+++ b/platform/qt/include/qmapboxgl.hpp
@@ -72,8 +72,8 @@ public:
QString localFontFamily() const;
void setLocalFontFamily(const QString &);
- std::function<std::string(const std::string &&)> resourceTransform() const;
- void setResourceTransform(const std::function<std::string(const std::string &&)> &);
+ std::function<std::string(const std::string &)> resourceTransform() const;
+ void setResourceTransform(const std::function<std::string(const std::string &)> &);
private:
GLContextMode m_contextMode;
@@ -87,7 +87,7 @@ private:
QString m_accessToken;
QString m_apiBaseUrl;
QString m_localFontFamily;
- std::function<std::string(const std::string &&)> m_resourceTransform;
+ std::function<std::string(const std::string &)> m_resourceTransform;
};
struct Q_MAPBOXGL_EXPORT QMapboxGLCameraOptions {
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index 329bf23085..0bfc6abf73 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -439,8 +439,7 @@ void QMapboxGLSettings::setLocalFontFamily(const QString &family)
/*!
Returns resource transformation callback used to transform requested URLs.
*/
-std::function<std::string(const std::string &&)> QMapboxGLSettings::resourceTransform() const
-{
+std::function<std::string(const std::string &)> QMapboxGLSettings::resourceTransform() const {
return m_resourceTransform;
}
@@ -452,8 +451,7 @@ std::function<std::string(const std::string &&)> QMapboxGLSettings::resourceTran
used add or remove custom parameters, or reroute certain requests to other
servers or endpoints.
*/
-void QMapboxGLSettings::setResourceTransform(const std::function<std::string(const std::string &&)> &transform)
-{
+void QMapboxGLSettings::setResourceTransform(const std::function<std::string(const std::string &)> &transform) {
m_resourceTransform = transform;
}
@@ -1744,8 +1742,9 @@ QMapboxGLPrivate::QMapboxGLPrivate(QMapboxGL *q, const QMapboxGLSettings &settin
resourceOptions);
if (settings.resourceTransform()) {
- m_resourceTransform = std::make_unique<mbgl::Actor<mbgl::ResourceTransform>>(*mbgl::Scheduler::GetCurrent(),
- [callback = settings.resourceTransform()] (mbgl::Resource::Kind, const std::string &&url_) -> std::string {
+ m_resourceTransform = std::make_unique<mbgl::Actor<mbgl::ResourceTransform>>(
+ *mbgl::Scheduler::GetCurrent(),
+ [callback = settings.resourceTransform()](mbgl::Resource::Kind, const std::string &url_) -> std::string {
return callback(std::move(url_));
});
auto fs = mbgl::FileSource::getSharedFileSource(resourceOptions);