i use QFileSystemWatcher to watch some directory, when i add a file to it, I can get the signal well, but now the question is how to get the added file name? QFileSystemWatcher NOW seemed to have no method to do it directly.
i use QFileSystemWatcher to watch some directory, when i add a file to it, I can get the signal well, but now the question is how to get the added file name? QFileSystemWatcher NOW seemed to have no method to do it directly.
J-P Nurmi
This feature, along other improvements have been suggested over and over again during the testing-cycle of Qt-4.2 preleases due to the inability of QFileSystemWatcher to provide more details about the event that caused the signal(s). Yet, as of now nothing indicates that these shortcomings will be addressed int Qt's near future releases. The solution is to build a custom class to carry out the monitoring of files and directories.
This shouldn't be too hard using your operating systems native directoy-monitoring facilities if your code is only intended to run on a single platform. it will however be much more difficult to implement this as a platform independet solution. I needed to write such a class on linux a while ago, so I resorted to using fam (or gamin which is API compatible to fam) and it wasn't too much of labour implementing it.
http://oss.sgi.com/projects/fam/faq.html
good luck!
The future looks dim on this one, task 182019 is set to "wont fix".
Bookmarks