History

refresh the Asset Browser when switching domains

Stephen Birarda committed 10 years ago

Commit 19422611 parent 588a5da4 files · +43 −6Browse files

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

Unified · Split

interface/src/scripting/AssetMappingsScriptingInterface.cpp+14−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313
1414 #include <QtScript/QScriptEngine>
1515 #include <QtCore/QFile>
16+#include <QtCore/QThread>
1617
1718 #include <AssetRequest.h>
1819 #include <AssetUpload.h>
@@ -20,6 +21,19 @@ · 1 unmodified line
2021 #include <NetworkLogging.h>
2122 #include <OffscreenUi.h>
2223
24+void AssetMappingModel::clear() {
25+ // make sure we are on the same thread before we touch the hash
26+ if (thread() != QThread::currentThread()) {
27+ QMetaObject::invokeMethod(this, "clear");
28+ return;
29+ }
30+
31+ qDebug() << "Clearing loaded asset mappings for Asset Browser";
32+
33+ _pathToItemMap.clear();
34+ QStandardItemModel::clear();
35+}
36+
2337 AssetMappingsScriptingInterface::AssetMappingsScriptingInterface() {
2438 _proxyModel.setSourceModel(&_assetMappingModel);
2539 _proxyModel.setSortRole(Qt::DisplayRole);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t