QFileSystemModel update problem for shared network (samba) location
I'm using QFileSystemModel and QTreeView to display files tree from a shared network location (Samba).
Code:
Model->setRootPath("//HostName");
TreeView->setModel(Model);
TreeView->setRootIndex(Model->index("//HostName"));
The code works fine and I got the file tree. However, it can not automatically pick up the changes there. For example, if I create a new file there, the tree don't display this new file.
When I set the path to a directory on local hard drive, like "D:/temp". It works. It picks up the changes and update itself.
Any idea how can I pick up changes from a shared network location and refresh the model/tree?
Re: QFileSystemModel update problem for shared network (samba) location
You could trigger the refresh manually if you changed something on the fs (assuming to change comes not from "outside")
Re: QFileSystemModel update problem for shared network (samba) location
It doesn't work on networked file systems as it has no way of knowing when something has been changed. On a local file system, the OS will inform if something changes as all file i/o go through the OS.