Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.1
-
None
-
Windows 7, Symbian
-
cca7611e260c8ba86da3b01a83e70447c1c362bc
Description
When folder property of FolderListModel is changed back and forth while showDirs property is set to false, directories that have been browsed into with the FolderListModel become visible in the model.
The following code illustrates the problem:
import QtQuick 1.0 import Qt.labs.folderlistmodel 1.0 Rectangle { width: 360 height: 640 FolderListModel { id: folderModel folder: "file:///c:/" showDirs: false } ListView { id: list model: folderModel anchors { top: parent.top left: parent.left right: parent.right bottom: button.top } delegate: Rectangle { width: list.width height: 60 Text{ anchors.centerIn: parent text: fileName } } } Rectangle { id: button anchors { left: parent.left right: parent.right bottom: parent.bottom } height: 60 color: "blue" MouseArea { anchors.fill: parent onClicked: { if (folderModel.folder == "file:///c:/code/") { folderModel.folder = "file:///c:/" } else { folderModel.folder = "file:///c:/code/" } } } } }
1. Start the application, note that no directories in C:\ are not visible on the list.
2. Press the blue area at the bottom of the view, the folder is changed to C:\code, again, no directories are visible in the view.
3. Press the blue area again, the folder is changed back to C:\, now directory 'code' is visible on the list in addition to the files. Other directories still remain hidden. I guess also code-directory should not become visible.