D13898: Use non deprecated fastInsert in file.cpp (first of many to come)

David Faure noreply at phabricator.kde.org
Sat Jul 7 22:55:21 BST 2018


dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> bruns wrote in file.cpp:889
> isn't this the same as linkTargetBuffer?

Yes, and in fact linkTargetBuffer is more correct. toLocal8Bit() is incorrect, QFile::encodeName/decodeName must be used for QByteArray<->QString conversions for filenames.

> bruns wrote in file.cpp:864
> The comment does not solve the issue, neither does it help to clarify anything ...
> 
> `buffersize` has to be larger than buff.st_size, otherwise there is no possibility to diffentiate the 'fits exactly' and 'was truncated' cases, both will return `n == buffersize`.
> 
> the correct fix is to use:
> 
>   // Add one to the size, to be able to detect truncation -
>   // in case n == bufferSize, truncation *may* have occured
>   size_t bufferSize = qBound(lowerLimit, buff.st_size + 1, 1024);

Given that this fix is completely unrelated to this commit, it should rather be separated into a different commit...

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D13898

To: jtamate, dfaure, #frameworks
Cc: bruns, kde-frameworks-devel, michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180707/3beea502/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list