summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/Palettes
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2018-08-22 16:15:53 +0300
committerMahmoud Badri <mahmoud.badri@qt.io>2018-08-23 12:41:11 +0000
commit0f113ae7d7965fe18976f396a0157ed4a124e358 (patch)
tree5eb31d556779fab422841008c5c73b17ea95df4e /src/Authoring/Studio/Palettes
parent16970998648adec5ccf98490ce751549c71dc064 (diff)
Fix rendering subpresentations in the viewer
- The Editor now sends to the viewer a copy of the uia file with the preview suffix with the 'initial' attribute set to current document. - Added a short cut for new project - Hid the project file, preview and autosave uip(s) from the project palette. Task-number: QT3DS-2113 Change-Id: Ifc254d184fe097a43abff789d0e45c3d6590b726 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes')
-rw-r--r--src/Authoring/Studio/Palettes/Project/ProjectFileSystemModel.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/Authoring/Studio/Palettes/Project/ProjectFileSystemModel.cpp b/src/Authoring/Studio/Palettes/Project/ProjectFileSystemModel.cpp
index 9190b9a9..4df59c55 100644
--- a/src/Authoring/Studio/Palettes/Project/ProjectFileSystemModel.cpp
+++ b/src/Authoring/Studio/Palettes/Project/ProjectFileSystemModel.cpp
@@ -716,21 +716,18 @@ bool ProjectFileSystemModel::hasVisibleChildren(const QModelIndex &modelIndex) c
bool ProjectFileSystemModel::isVisible(const QModelIndex &modelIndex) const
{
- bool result = false;
+ QString path = modelIndex.data(QFileSystemModel::FilePathRole).toString();
- if (modelIndex == m_rootIndex) {
- result = true;
- } else {
- QString path = modelIndex.data(QFileSystemModel::FilePathRole).toString();
- QFileInfo fileInfo(path);
- if (fileInfo.isFile()) {
- result = getIconType(path) != OBJTYPE_UNKNOWN;
- } else {
- result = true;
- }
+ if (modelIndex == m_rootIndex || QFileInfo(path).isDir())
+ return true;
+
+ if (path.endsWith(QLatin1String("_autosave.uip"))
+ || path.endsWith(QLatin1String("_@preview@.uip"))
+ || path.endsWith(QLatin1String(".uia"))) {
+ return false;
}
- return result;
+ return getIconType(path) != OBJTYPE_UNKNOWN;
}
void ProjectFileSystemModel::modelRowsInserted(const QModelIndex &parent, int start, int end)