[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Does KDirWatch emit dirty() signal when the current process
From:       "Nicolas Ternisien" <nicolas.ternisien () gmail ! com>
Date:       2007-08-25 16:56:44
Message-ID: ccba71b50708250956r1cd76f36gac848a43d5905575 () mail ! gmail ! com
[Download RAW message or body]

I've finally found a work around.

It seems that the dirty() signal is not emitted (or is not "slotted")
if the process event has no time to process it.

Please look at the attachment, where I've added a unit test which proves th=
is.

In the testWatch() method, the code :

=09//Needed to be sure the signal will be emitted
=09QTest::qWait(1000);


could be commented to see that the signal being not emitted, even if
the file is modified.

I personally do not understand the real reason of this problem (but
the qWait() helps me to create my unit test, so everything is okay ;-)

To launch it :
cmake .
make
./dirwatcherTest

Regards.

Thanks again for your help Flavio.


2007/8/23, Flavio Castelli <micron@bglug.it>:
> On Thursday 23 August 2007 10:26:19 Nicolas Ternisien wrote:
> > Do you all agree with the fact that KDirWatch should emit dirty()
> > signal if the current process modify a file it is watched ?
> Yesterday I give a short look to your code and I run it. As far as I have=
 seen
> KDirWatch receive the write event:
> QDEBUG : SystemReaderTest::testMultipleLines() qttest(7176)/kio (KDirWatc=
h)
> KDirWatchPrivate::inotifyEventReceived:
> KDirWatchPrivate::inotifyEventReceived
>
> I didn't have enough time to debug your code. Instead I've added few line=
s of
> code that reproduce the situation to a small program I wrote for testing
> KDirWatch.
> You can grab it here:
> wget http://www.flavio.castelli.name/files/kdirwatcher_test.tar.bz2
>
> You've to run the program in this way:
> ./kdirwatcher -f /tmp/foo
>
> Then you will see something like:
> kdirwatcher(7498) Dirwatcher::slotDirty: Dirwatcher: Dirty:  "/tmp/foo"
>
> Dirwatcher is the process that added the watch on /tmp/foo and as you can=
 see
> it has received the dirty signal.
>
> Hope it will help you.
>
> Cheers
>         Flavio
> --
> |=A7 micron<- ICQ #118796665
> |=A7 GPG Key:
> |=A7  ~ Keyserver: pgp.mit.edu
> |=A7  ~ KeyID: 6D632BED
>
> ~ "Progress is merely a realisation of utopias" ~
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscr=
ibe <<
>

["kdirwatcher_test.tar.gz" (application/x-gzip)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic