Fix TreeView root index.

Parent folders will now be hidden based on the root folder selection in
the GUI.
This commit is contained in:
2026-02-01 13:07:27 -05:00
parent c70bba16e4
commit 048d40eb83
2 changed files with 21 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ Rectangle {
boundsBehavior: Flickable.StopAtBounds
boundsMovement: Flickable.StopAtBounds
clip: true
rootIndex: FileSystem.rootIndex
Component.onCompleted: {
FileSystem.setDirectory(root.rootDirectory)
@@ -122,13 +123,13 @@ Rectangle {
text: qsTr("Set as root index")
onTriggered: {
console.log("Setting directory: " + treeDelegate.filePath)
FileSystem.setDirectory(treeDelegate.filePath)
FileSystem.rootIndex = FileSystem.setDirectory(treeDelegate.filePath)
}
}
Action {
text: qsTr("Reset root index")
onTriggered: {
FileSystem.setDirectory("")
FileSystem.rootIndex = FileSystem.setDirectory(root.rootDirectory)
}
}
}