diff options
Diffstat (limited to 'src/Authoring/Qt3DStudio/Palettes/Project/ProjectFileSystemModel.cpp')
-rw-r--r-- | src/Authoring/Qt3DStudio/Palettes/Project/ProjectFileSystemModel.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Authoring/Qt3DStudio/Palettes/Project/ProjectFileSystemModel.cpp b/src/Authoring/Qt3DStudio/Palettes/Project/ProjectFileSystemModel.cpp index 2287f294..77a2a24a 100644 --- a/src/Authoring/Qt3DStudio/Palettes/Project/ProjectFileSystemModel.cpp +++ b/src/Authoring/Qt3DStudio/Palettes/Project/ProjectFileSystemModel.cpp @@ -66,8 +66,15 @@ ProjectFileSystemModel::ProjectFileSystemModel(QObject *parent) : QAbstractListM m_projectReferencesUpdateTimer.setSingleShot(true); m_projectReferencesUpdateTimer.setInterval(0); + m_shaderCheckTimer.setSingleShot(true); + m_shaderCheckTimer.setInterval(3000); + connect(&m_projectReferencesUpdateTimer, &QTimer::timeout, this, &ProjectFileSystemModel::updateProjectReferences); + connect(&m_shaderCheckTimer, &QTimer::timeout, [&](){ + checkShaders(); + updateRoles({IsProjectReferencedRole, HasWarningRole, ExtraIconRole}); + }); } QHash<int, QByteArray> ProjectFileSystemModel::roleNames() const @@ -222,9 +229,6 @@ void ProjectFileSystemModel::updateReferences() std::for_each(renderableList.begin(), renderableList.end(), addReferencesRenderable); m_references.insert(projectPath); - - checkShaders(); - updateRoles({IsReferencedRole, Qt::DecorationRole, HasWarningRole, ExtraIconRole}); } @@ -416,7 +420,6 @@ void ProjectFileSystemModel::updateProjectReferences() } m_projectReferencesUpdateMap.clear(); - checkShaders(); updateRoles({IsProjectReferencedRole, HasWarningRole, ExtraIconRole}); } @@ -1352,6 +1355,7 @@ void ProjectFileSystemModel::onFilesChanged( m_projectReferencesUpdateMap.insert(filePath, false); } m_projectReferencesUpdateTimer.start(); + m_shaderCheckTimer.start(); } } } |