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

Mark Gaiser markg85 at gmail.com
Wed Apr 29 23:53:47 UTC 2015


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



autotests/accessmanagertest.cpp (line 79)
<https://git.reviewboard.kde.org/r/123514/#comment54559>

    The / should be a QDir::separator, no?



autotests/accessmanagertest.cpp (line 84)
<https://git.reviewboard.kde.org/r/123514/#comment54560>

    QVERIFY this one?



autotests/accessmanagertest.cpp (line 95)
<https://git.reviewboard.kde.org/r/123514/#comment54557>

    nitpick: space



autotests/jobtest.cpp (line 250)
<https://git.reviewboard.kde.org/r/123514/#comment54558>

    Not an issue, more my preference. Slightly more descriptive names would be better imho.



src/core/transferjob.cpp (line 315)
<https://git.reviewboard.kde.org/r/123514/#comment54561>

    Coding style.
    if () {
    
    }



src/core/transferjob.cpp (line 400)
<https://git.reviewboard.kde.org/r/123514/#comment54554>

    This name is misleading. I read it like: "this is a bool that indicates if a read succeeded". While that is _also_ what it does, it basically returns the number of bytes read. Perhaps name it "bytesRead" or something alike?



src/core/transferjob.cpp (line 401)
<https://git.reviewboard.kde.org/r/123514/#comment54553>

    spaces around >=



src/core/transferjob.cpp (line 408)
<https://git.reviewboard.kde.org/r/123514/#comment54555>

    Code style.
    if () {
    
    }



src/core/transferjob.cpp (line 438)
<https://git.reviewboard.kde.org/r/123514/#comment54556>

    I might be missing the reason, but why do you always send an empty bytearray? You have an if just a couple lines higher that sends data if there is remaining data.
    
    Should this be needed at all?


In general i like this idea. So a +1 for the idea, that's not a real +1 :)

- Mark Gaiser


On apr 29, 2015, 4:28 p.m., Aleix Pol Gonzalez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123514/
> -----------------------------------------------------------
> 
> (Updated apr 29, 2015, 4:28 p.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
> -----
> 
>   src/core/transferjob.h e2fd2e7 
>   src/core/job_p.h 7ec1a69 
>   autotests/jobtest.cpp 327470a 
>   autotests/jobtest.h 5ccd492 
>   autotests/accessmanagertest.cpp 5d52553 
>   autotests/CMakeLists.txt 7bba3ea 
>   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/20150429/0e2c1a3a/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list