[Qt-creator] Strange behavior of Utils::FileSystemWatcher

Daniel Teske daniel.teske at nokia.com
Thu Apr 5 12:04:30 CEST 2012


Utils::FileSystemWatcher solves only one is issue of QFileSystemWatcher. That 
is on some platforms watching file systems is pretty expensive and has a 
significant overhead per QFileSystemWatcher.

Utils::FileSystemWatcher does not actually solve the problem that 
QFileSystemWatcher looses the watch if a file is replaced by a delete + rename, 
like you described:

> However, when I switched I've discovered very strange behavior: I
> get signal fileChanged for certain file only once. When it's modified
> second time I get no signal for this file (if I modify ither fiiles I get
> signal first time but only once for each file). 

We probably should get rid of Utils::FileSystemWatcher, or fix it to actually 
work better then QFileSystemWatcher.

> If I switch back to QFSW
> everything works fine again.
That can't be, if you don't readd the file after a fileChanged() signal, you 
won't get a second signal out of QFSW either.
 
> Does anybody have a clue?
Use a dummy IDocument derived class, for example take a look at WatchableFile 
in maemoglobal.h

daniel



More information about the Qt-creator mailing list