Exclude /proc being watched by the intfilesystemwatcher installed by QFileSystemModel
Hi,
I am trying to display "/" in a treeView. I have a QFileSystemModel with setRootIndex("/"). I want to do some deep file search on this fileSystemModel. So create a signal/slot connection
Code:
connect(fileModel,
SIGNAL(directoryLoaded
(QString),
this, on_dir_tree_loaded
() ))
The problem is that the internal QFileSystemWatcher attached to QFileSystemModel never finishes reading /proc and spits out error messages like
Code:
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: Permission denied
I guess that there are new system processes continuously making entries inside /proc and are causing the problem.
How can I exclude /proc being watched, or alternatively get around this problem?
Cheers,
Kodanda
Re: Exclude /proc being watched by the intfilesystemwatcher installed by QFileSystemM
I am assuming / and /proc are different mount points in your file system? If so, can you just iterate over the various mount points and only add those to QFileSystemWatcher that you actually want to watch?
i.e. Use QStorageInfo::mountedVolumes()?
Edit: One more thought, have you tried removing /proc after you set the root to "/"? Perhaps QFileSystemWatcher::removePath("/proc") may accomplish what you want?