mirror of
https://github.com/overte-org/overte.git
synced 2025-04-24 05:53:29 +02:00
Don't refresh if not connected to the Asset Server
This commit is contained in:
parent
1a571d0991
commit
8583be41ce
1 changed files with 7 additions and 2 deletions
|
@ -19,11 +19,12 @@
|
|||
#include <AssetUpload.h>
|
||||
#include <MappingRequest.h>
|
||||
#include <NetworkLogging.h>
|
||||
#include <NodeList.h>
|
||||
#include <OffscreenUi.h>
|
||||
|
||||
static const int AUTO_REFRESH_INTERVAL = 1000;
|
||||
|
||||
const int assetMappingModelMetatypeId = qRegisterMetaType<AssetMappingModel*>("AssetMappingModel*");
|
||||
int assetMappingModelMetatypeId = qRegisterMetaType<AssetMappingModel*>("AssetMappingModel*");
|
||||
|
||||
AssetMappingsScriptingInterface::AssetMappingsScriptingInterface() {
|
||||
_proxyModel.setSourceModel(&_assetMappingModel);
|
||||
|
@ -195,7 +196,11 @@ AssetMappingModel::AssetMappingModel() {
|
|||
setupRoles();
|
||||
|
||||
connect(&_autoRefreshTimer, &QTimer::timeout, this, [this] {
|
||||
refresh();
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
auto assetServer = nodeList->soloNodeOfType(NodeType::AssetServer);
|
||||
if (assetServer) {
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
_autoRefreshTimer.setInterval(AUTO_REFRESH_INTERVAL);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue