Review Request 123514: Make it possible to treat non-sequential QIODevice asynchronously

Aleix Pol Gonzalez aleixpol at kde.org
Sat May 2 00:56:42 UTC 2015



> On May 1, 2015, 4:01 p.m., David Faure wrote:
> > autotests/jobtest.cpp, line 265
> > <https://git.reviewboard.kde.org/r/123514/diff/3/?file=364722#file364722line265>
> >
> >     This particular syntax is too recent to be used, but you could create a QTimer and then connect its timeout signal to a lambda, that should work fine with Qt 5.2 as well.

So the lambda is ok? Then it's fixed on the next version.


> On May 1, 2015, 4:01 p.m., David Faure wrote:
> > autotests/jobtest.cpp, line 268
> > <https://git.reviewboard.kde.org/r/123514/diff/3/?file=364722#file364722line268>
> >
> >     better do this comparison after the exec, to be able to use QCOMPARE. And to make sure that "slot" was actually called. Right now, if it's not called, the test still passes.

After the exec the buffer is at the end, so the bytesAvailable are 0.

If the timer slot is never called, the test doesn't pass. In fact, it stops forever on the exec() waiting for input or close or something.


- Aleix


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123514/#review79761
-----------------------------------------------------------


On April 30, 2015, 2:08 a.m., Aleix Pol Gonzalez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123514/
> -----------------------------------------------------------
> 
> (Updated April 30, 2015, 2:08 a.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> So far, we used to just read whenever some data was required. This works on sequential devices because the data is already available. This is not the case when we have a sequential device, such as a socket, where data arrives when it arrives. This will also prove useful on non-sequential devices as well when we want to keep reading in case new data appears.
> 
> This patch takes the AsyncDataEnabled setting on accordinly by:
> 
> * only reading from the device when readyRead is available.
> * finishes the transfer whenever the device is closed.
> 
> 
> Diffs
> -----
> 
>   autotests/CMakeLists.txt 7bba3ea 
>   autotests/accessmanagertest.cpp 5d52553 
>   autotests/jobtest.h 5ccd492 
>   autotests/jobtest.cpp 327470a 
>   src/core/job_p.h 7ec1a69 
>   src/core/transferjob.h e2fd2e7 
>   src/core/transferjob.cpp 97a724e 
>   src/widgets/accessmanager.cpp b4ec811 
> 
> Diff: https://git.reviewboard.kde.org/r/123514/diff/
> 
> 
> Testing
> -------
> 
> Tests still pass, new test also passes.
> 
> The test is using lambdas to delay write. I don't think it's available.
> Can I add some kind of #if HAS_LAMBDA and make the test depend on it?
> I don't think adding slots and make the buffer an attribute would be very nice... I can also sub-class the buffer.
> 
> 
> Thanks,
> 
> Aleix Pol Gonzalez
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150502/9599d7e3/attachment.html>


More information about the Kde-frameworks-devel mailing list