History

Don't refresh if not connected to the Asset Server

Atlante45 committed 9 years ago

Commit 8583be41 parent 1a571d01 file · +7 −2Browse files

Showing the changes to interface/src/scripting/AssetMappingsScriptingInterface.cpp (1 of 1 file). Show all

Unified · Split

interface/src/scripting/AssetMappingsScriptingInterface.cpp+7−2
@@ -19,11 +19,12 @@ · 18 unmodified lines
19#include <AssetUpload.h>19#include <AssetUpload.h>
20#include <MappingRequest.h>20#include <MappingRequest.h>
21#include <NetworkLogging.h>21#include <NetworkLogging.h>
22#include <NodeList.h>
22#include <OffscreenUi.h>23#include <OffscreenUi.h>
23 24
24static const int AUTO_REFRESH_INTERVAL = 1000;25static const int AUTO_REFRESH_INTERVAL = 1000;
25 26
26const int assetMappingModelMetatypeId = qRegisterMetaType<AssetMappingModel*>("AssetMappingModel*");27int assetMappingModelMetatypeId = qRegisterMetaType<AssetMappingModel*>("AssetMappingModel*");
27 28
28AssetMappingsScriptingInterface::AssetMappingsScriptingInterface() {29AssetMappingsScriptingInterface::AssetMappingsScriptingInterface() {
29 _proxyModel.setSourceModel(&_assetMappingModel);30 _proxyModel.setSourceModel(&_assetMappingModel);
@@ -195,7 +196,11 @@ AssetMappingModel::AssetMappingModel() { · 165 unmodified lines
195 setupRoles();196 setupRoles();
196 197
197 connect(&_autoRefreshTimer, &QTimer::timeout, this, [this] {198 connect(&_autoRefreshTimer, &QTimer::timeout, this, [this] {
198 refresh();199 auto nodeList = DependencyManager::get<NodeList>();
200 auto assetServer = nodeList->soloNodeOfType(NodeType::AssetServer);
201 if (assetServer) {
202 refresh();
203 }
199 });204 });
200 _autoRefreshTimer.setInterval(AUTO_REFRESH_INTERVAL);205 _autoRefreshTimer.setInterval(AUTO_REFRESH_INTERVAL);
201}206}