mirror of
https://github.com/overte-org/overte.git
synced 2025-04-07 02:12:53 +02:00
Patch interface redirect code
This commit is contained in:
parent
b1f00d6f22
commit
3605b3d560
3 changed files with 3 additions and 16 deletions
|
@ -218,7 +218,7 @@ GeometryResource::GeometryResource(const GeometryResource& other) :
|
|||
}
|
||||
|
||||
void GeometryResource::downloadFinished(const QByteArray& data) {
|
||||
if (_activeUrl.fileName().toLower().endsWith(".fst")) {
|
||||
if (_effectiveBaseURL.fileName().toLower().endsWith(".fst")) {
|
||||
PROFILE_ASYNC_BEGIN(resource_parse_geometry, "GeometryResource::downloadFinished", _url.toString(), { { "url", _url.toString() } });
|
||||
|
||||
// store parsed contents of FST file
|
||||
|
@ -291,19 +291,6 @@ void GeometryResource::downloadFinished(const QByteArray& data) {
|
|||
}
|
||||
}
|
||||
|
||||
bool GeometryResource::handleFailedRequest(ResourceRequest::Result result) {
|
||||
if (_shouldFailOnRedirect && result == ResourceRequest::Result::RedirectFail) {
|
||||
auto newPath = _request->getRelativePathUrl();
|
||||
if (newPath.fileName().toLower().endsWith(".fst")) {
|
||||
_activeUrl = newPath;
|
||||
_shouldFailOnRedirect = false;
|
||||
makeRequest();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return Resource::handleFailedRequest(result);
|
||||
}
|
||||
|
||||
void GeometryResource::onGeometryMappingLoaded(bool success) {
|
||||
if (success && _geometryResource) {
|
||||
_hfmModel = _geometryResource->_hfmModel;
|
||||
|
|
|
@ -80,7 +80,7 @@ class GeometryResource : public Resource, public Geometry {
|
|||
public:
|
||||
using Pointer = QSharedPointer<GeometryResource>;
|
||||
|
||||
GeometryResource(const QUrl& url, const ModelLoader& modelLoader) : Resource(url), _modelLoader(modelLoader) { _shouldFailOnRedirect = !url.fileName().toLower().endsWith(".fst"); }
|
||||
GeometryResource(const QUrl& url, const ModelLoader& modelLoader) : Resource(url), _modelLoader(modelLoader) {}
|
||||
GeometryResource(const GeometryResource& other);
|
||||
|
||||
QString getType() const override { return "Geometry"; }
|
||||
|
@ -88,7 +88,6 @@ public:
|
|||
virtual void deleter() override;
|
||||
|
||||
virtual void downloadFinished(const QByteArray& data) override;
|
||||
bool handleFailedRequest(ResourceRequest::Result result) override;
|
||||
void setExtra(void* extra) override;
|
||||
|
||||
virtual bool areTexturesLoaded() const override { return isLoaded() && Geometry::areTexturesLoaded(); }
|
||||
|
|
|
@ -577,6 +577,7 @@ Resource::Resource(const Resource& other) :
|
|||
Resource::Resource(const QUrl& url) :
|
||||
_url(url),
|
||||
_activeUrl(url),
|
||||
_effectiveBaseURL(url),
|
||||
_requestID(++requestID) {
|
||||
init();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue