[Development] QFileSystemWatcher and Recursive Monitoring

d3fault d3faultdotxbe at gmail.com
Mon Jul 23 03:54:01 CEST 2012


I don't like your single signal design. It's cross platform only in that it
will compile/function on every platform. The application will behave
differently in the slot connected to said signal on mac than on
windows/linux. We should not expect every _user_ app to have separate
codepaths for different platforms. A.k.a exactly what Qt isn't about.

Just because you attempted the perfect solution once and failed, doesn't
mean it can't be done. At the end of the day we just need some #ifdef
Q_MAC_OSX (or maybe this can/should be in QPA) with boring file property
(filename,filesize,maybe-crc32?,etc) comparison stuff before determing the
proper signal to emit.

I also think we should remove the 256 limit even for non-recursive
monitoring on the Mac (always use FSEvents). 256 is a ridiculously small
limit for any app wanting to do any slightly serious fs event monitoring.

Aside: perhaps QObject::connectNotify can be cleverly used to skip the
string comparison stage for an event if there is no slot connected to that
particular signal. So if they only connect to dirChanged, the internal code
never uses the 'expensive' #ifdef'd out file change detected code.

d3fault
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120722/c4cf48d8/attachment.html>


More information about the Development mailing list