mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 23:40:11 +02:00
Don't mark failed models loaded, emit failure
This commit is contained in:
parent
3e9e083df5
commit
4d47126ae4
2 changed files with 11 additions and 4 deletions
|
@ -290,13 +290,16 @@ NetworkGeometry::NetworkGeometry(const GeometryResource::Pointer& networkGeometr
|
||||||
connect(_resource.data(), &Resource::finished, this, &NetworkGeometry::resourceFinished);
|
connect(_resource.data(), &Resource::finished, this, &NetworkGeometry::resourceFinished);
|
||||||
connect(_resource.data(), &Resource::onRefresh, this, &NetworkGeometry::resourceRefreshed);
|
connect(_resource.data(), &Resource::onRefresh, this, &NetworkGeometry::resourceRefreshed);
|
||||||
if (_resource->isLoaded()) {
|
if (_resource->isLoaded()) {
|
||||||
resourceFinished();
|
resourceFinished(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkGeometry::resourceFinished() {
|
void NetworkGeometry::resourceFinished(bool success) {
|
||||||
|
if (success) {
|
||||||
_instance = std::make_shared<Geometry>(*_resource);
|
_instance = std::make_shared<Geometry>(*_resource);
|
||||||
}
|
}
|
||||||
|
emit finished(success);
|
||||||
|
}
|
||||||
|
|
||||||
void NetworkGeometry::resourceRefreshed() {
|
void NetworkGeometry::resourceRefreshed() {
|
||||||
_instance.reset();
|
_instance.reset();
|
||||||
|
|
|
@ -117,8 +117,12 @@ public:
|
||||||
/// Returns the geometry, if it is loaded (must be checked!)
|
/// Returns the geometry, if it is loaded (must be checked!)
|
||||||
const Geometry::Pointer& getGeometry() { return _instance; }
|
const Geometry::Pointer& getGeometry() { return _instance; }
|
||||||
|
|
||||||
|
signals:
|
||||||
|
/// Emitted when the NetworkGeometry loads (or fails to)
|
||||||
|
void finished(bool success);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void resourceFinished();
|
void resourceFinished(bool success);
|
||||||
void resourceRefreshed();
|
void resourceRefreshed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue