Review Request 111636: Port away from kde_file.h in AuthInfo (KIO)

David Faure faure at kde.org
Tue Jul 23 11:19:04 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111636/#review36282
-----------------------------------------------------------



staging/kio/src/core/authinfo.cpp
<http://git.reviewboard.kde.org/r/111636/#comment26828>

    += should be faster (same on all the lines that say line = line.append(...)



staging/kio/src/core/authinfo.cpp
<http://git.reviewboard.kde.org/r/111636/#comment26853>

    For some reason Qt has a Q_FOREVER() macro for this. I admit that I'm not sure what it difference it makes compared to while(true) though....



staging/kio/src/core/authinfo.cpp
<http://git.reviewboard.kde.org/r/111636/#comment26829>

    split(QLatin1Char(' '), ...) would be faster.



staging/kio/src/core/authinfo.cpp
<http://git.reviewboard.kde.org/r/111636/#comment26830>

    merge with previous line (C++ allows to declare and use variables on the same line, which is much more modular and flexible than the C way)



staging/kio/src/core/authinfo.cpp
<http://git.reviewboard.kde.org/r/111636/#comment26851>

    The old didn't have such a strict permission checking. Is it intended to be strict? Or would it be enough to check if open(ReadOnly) succeeds or fails?



staging/kio/src/core/authinfo.cpp
<http://git.reviewboard.kde.org/r/111636/#comment26852>

    Making a member variable read from a function-local iodevice sounds dangerous to me. If you use d->fstream from a method not called by this one, you get a crash.
    
    Maybe it would be better to pass the stream to the 2 methods that need it, rather than having it as a member variable? Or making file a member too.
    Well, I guess that's not needed, it just seems fragile to have a member that is only usable when called from within one method.
    
    ==
    
    A 2nd issue: what should be the encoding of the QTextStream? i.e. which encoding does the file use?


- David Faure


On July 21, 2013, 11:41 p.m., David Gil Oliva wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111636/
> -----------------------------------------------------------
> 
> (Updated July 21, 2013, 11:41 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Description
> -------
> 
> Port away from kde_file.h in AuthInfo (KIO)
> 
> I have tried not to touch much code, but I finally rewrote some parts to make them easier to understand.
> 
> 
> Diffs
> -----
> 
>   staging/kio/src/core/authinfo.h d6415b2f2e9ccec7c3e046f569fb44dbbc879d6b 
>   staging/kio/src/core/authinfo.cpp 65ebacf84e989f19f1b896c596a6b24185c67447 
> 
> Diff: http://git.reviewboard.kde.org/r/111636/diff/
> 
> 
> Testing
> -------
> 
> It builds. I have tested the part of the code not related to loginMap with a little program and .netrc sample files, to check whether it correctly parses the information.
> 
> 
> Thanks,
> 
> David Gil Oliva
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130723/d6d3b085/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list