MEONMedical / Log4Qt

Log4Qt - Logging for the Qt cross-platform application framework
Apache License 2.0
589 stars 236 forks source link

Work around a bug in the inotify qfsw implementation (Qt bug 19350) #25

Closed chehrlic closed 7 years ago

chehrlic commented 7 years ago

The inotify implementation of QFileSystemWatcher seems to have a bug when the watched file is replaced by another one. For example kate does save the current content in a temporary file and then renames it. After this operation, QFileSystemWatcher/INotify does no longer watch this file. This leads to the problem that one can only modify the property file once without restarting the application :(

andibacher commented 7 years ago

First I don't think it is actually a bug in the file watcher implemantation. Regarding your patch: Is this solution working reliable? What is if the time between deletion and renaming/creation of the file is too long. In this case I think your patch will not work. A better aproach would be to monitor the directory too and then handle the readding of the watched file on the directory change signal. Your patch will probably work in most cases but I would like add a patch that also work in cases where the time between deletion and renaming/creation is too long.

andibacher commented 7 years ago

Added re-add of watched config files to master and branch 1.4