Review Request 124877: fix corruption of startupconfig(files) in Qt5.6
Takahiro Hashimoto
kenya888 at gmail.com
Mon Aug 31 17:24:20 UTC 2015
> On 9月 1, 2015, 2 a.m., Aleix Pol Gonzalez wrote:
> > To be honest, I don't see how this should make a difference...
I'm sorry for lacking of my explanation...
Please see the difference of QString::fromLocal8Bit(const QByteArray &str) implementation between Qt 5.5 and 5.6
(5.5) http://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qstring.h?h=5.5#n541
(5.6) http://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qstring.h#n545
QString::fromLocal8Bit(const QByteArray &str) no longer use qstrlen() so that the padding data in QByteArray is included in the return value. It's the root cause of this problem.
If we want to use QString::fromLocal8Bit() with QByteArray excluding padding data with Qt 5.6, we can use inline function QString::fromLocal8Bit(const char *str, int size = -1)
http://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qstring.h#n536
I don't know the clear reason for the text buffer in kdostartupconfig being initialized with 1024bytes. But I think my patch is the smallest change to avoid the side effects.
- Takahiro
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124877/#review84659
-----------------------------------------------------------
On 9月 1, 2015, 1:33 a.m., Takahiro Hashimoto wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124877/
> -----------------------------------------------------------
>
> (Updated 9月 1, 2015, 1:33 a.m.)
>
>
> Review request for Plasma.
>
>
> Bugs: 351609
> https://bugs.kde.org/show_bug.cgi?id=351609
>
>
> Repository: plasma-workspace
>
>
> Description
> -------
>
> Building Plasma5 with Qt 5.6 branch, kstartupconfig5/kdostartupconfig5 generates corrupted files.
>
> $HOME/.config/startupconfigfiles
> $HOME/.config/startupconfig
>
>
> Diffs
> -----
>
> startkde/kstartupconfig/kdostartupconfig.cpp 3944c06
>
> Diff: https://git.reviewboard.kde.org/r/124877/diff/
>
>
> Testing
> -------
>
> works for me.
>
> 1. execute kstartupconfig5
> 2. check if both files are not corrupted.
>
>
> Thanks,
>
> Takahiro Hashimoto
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20150831/33f048bf/attachment-0001.html>
More information about the Plasma-devel
mailing list