[Development] QFileSystemWatcher and Recursive Monitoring

Robert Knight robertknight at gmail.com
Sun Jul 22 23:02:15 CEST 2012


> This can be either quick-n-dirty
> passing a concatenated string (semicolon separated or whatever) as the path
> value, or getting fancy with passing pointers to structures that may have
> several pieces of info packed in

I'd just add an extra parameter to the signal which is empty for some events:

pathChanged(ChangeType type, const QString& path, const QString& originalPath);

or define a simple struct and pass by const-ref:

struct PathChange
{
  Type event;
  QString path;
  QString originalPath;
};

Regards,
Rob.

On 22 July 2012 21:29, logic.cpp <logic.cpp at gmail.com> wrote:
>> How will you handle renames?  It looks like ReadDirectoryChanges uses
>> two separate events, leaving it up to the user to match them up.
>>
>
> As for renames (and moves on Linux/X11) we'd need to come up with some mechanism
> to sebd 2 pieces of information in one signal. This can be either quick-n-dirty
> passing a concatenated string (semicolon separated or whatever) as the path
> value, or getting fancy with passing pointers to structures that may have
> several pieces of info packed in depending on whether it's a regular event or a
> rename/move event.
>
> Or I dunno, any other ideas? It's reallys just a technicality that can
> definitely be figured out easily.
> -regedit



More information about the Development mailing list