PDA

View Full Version : QFileSystemWatcher on linux



Talei
14th January 2012, 06:08
Hello,
I have a problem with QFileSystemWatcher on Linux (Debian - kernel 2.6.32-5-amd64, Qt: 4.7.3 ).
The problem is that after signal fileChanged(QString) is emited path, to the file that was changed, is automatically removed without my ingerention. This didn't happened on Win.

Am I missing here something obvious or this is standard behavior or bug?

hakermania
15th January 2012, 16:44
Hello Talei, I don't seem to get where 'is automatically removed' refers to. Does it refer to the file?

Talei
15th January 2012, 21:30
Situation is as fallow:
1. QFileSystemWatcher addPath( "some file path" ) addPath( "some directory path" )
2. file is edited signal is emited
3. in slot, connected to the signal, QFileSystemWatcher clears file list (not directory list)

qDebgu() output in slots


Adding path to QFileSystemWatcher files: ("/home/userName/test.txt") directories: ("/home/userName/")

qDebug() for QFileSystemWatcher::files() and directories()

in slot directoryChangedSlot(QString dir) files(): ("/home/userName/test.txt") directories: ("/home/userName/")
in slot fileChangedSlot(QString file) files(): () directories: ("/home/userName/")
in slot directoryChangedSlot(QString dir) files(): () directories: ("/home/userName/")

QFileSystemWatcher clears files() list after emits signal fileChanged(QString), but don't remove directories!
And ofcourse I don't use anywhere removePath()! test app uses only qDebug() and adPath().
Question is why?

Compiled with Qt 4.8.0 RC.