QFileWatcher infinite loop and can't move a folder which is watched
Hi everybody!
Let say there is an hierarchy of folder like that:
Code:
FolderA
FolderB1
FolderB2
FolderC
There is a QFileWatcher with addpath for each folder to watch absolutely all the hierarchy of folder.
The signal is connected to the QFileWatcher to know when to refresh the tree.
There is two problems that I can see and I need the light of experts on it:
1) If you try to delete FolderA on Windows Explorer, your application ends to an infinite loop. I tried a custom filewatcher from GitHub, this infinite loop is not present anymore. Qt bug?
2) If you try to move Folder B1 in FolderC on Windows Explorer, Windows Explorer says the operation is impossible, surely because of the filewatcher. But on other applications that update automatically on this same kind of things, like Unreal Engine, I can see it possible.
For the point number 1, it looks a Qt bug.
For the point number 2, I wonder if there is a trick to fix this impossible action.
Thanks!
Re: QFileWatcher infinite loop and can't move a folder which is watched
Solved, QFileWatcher is not enough robust, you need to use an external file watcher code from Qt to be robust.
Re: QFileWatcher infinite loop and can't move a folder which is watched
Quote:
you need to use an external file watcher
Can you post the GitHub link where you found this? Thanks.
Re: QFileWatcher infinite loop and can't move a folder which is watched
https://github.com/SpartanJ/efsw
Just, the best file watcher actually there, working perfectly!