QmlDesigner: Fix not loading assets in some cases

When user creates new project in the same QDS session,
assets view were empty.

Fixes: QDS-14523
Change-Id: Ifc56e85b556b73eaf8d29fff031e207e8f9ee182
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Shrief Gabr <shrief.gabr@qt.io>
This commit is contained in:
Amr Essam
2025-02-21 17:19:02 +02:00
committed by Amr Elsayed
parent ca2fc0d02a
commit 6f5debb5f5

View File

@@ -136,8 +136,7 @@ TreeView {
// view: make sure we will do an "expand all" (otherwise, the whole tree might
// be collapsed, and with our visible root not being the actual root of the tree,
// the entire tree would be invisible)
root.lastRowCount = -1
root.requestedExpandAll = true
root.reset()
}
function onFileChanged(filePath)
@@ -154,6 +153,17 @@ TreeView {
} // Connections
// Resets everything to its default state before reusing the widget
function reset()
{
root.lastRowCount = -1
root.rootPathDepth = 0
root.rootPathRow = 0
root.requestedExpandAll = true
// Attempt to force reload
updateRowsTimer.restart()
}
function addCreatedFolder(path)
{
root.__createdDirectories.push(path)