forked from qt-creator/qt-creator
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>
(cherry picked from commit 6f5debb5f5
)
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -136,8 +136,7 @@ TreeView {
|
|||||||
// view: make sure we will do an "expand all" (otherwise, the whole tree might
|
// 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,
|
// be collapsed, and with our visible root not being the actual root of the tree,
|
||||||
// the entire tree would be invisible)
|
// the entire tree would be invisible)
|
||||||
root.lastRowCount = -1
|
root.reset()
|
||||||
root.requestedExpandAll = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFileChanged(filePath)
|
function onFileChanged(filePath)
|
||||||
@@ -154,6 +153,17 @@ TreeView {
|
|||||||
|
|
||||||
} // Connections
|
} // 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)
|
function addCreatedFolder(path)
|
||||||
{
|
{
|
||||||
root.__createdDirectories.push(path)
|
root.__createdDirectories.push(path)
|
||||||
|
Reference in New Issue
Block a user