D7046: Use xcb-icccm to read the name property

Martin Flöser noreply at phabricator.kde.org
Wed Aug 2 15:06:55 UTC 2017


graesslin added inline comments.

INLINE COMMENTS

> fvogt wrote in client.cpp:1428
> That does not matter in this instance. `QString::fromUtf8(QByteArray(reply.name, reply.name_len));` does two copies:
> 
> - QByteArray copies name_len bytes from name into a heap-allocated buffer
> - QString converts the UTF8 data inside QByteArray into UTF-16, allocated on the heap
> 
> The first copy is unnecessary.

I'll keep the second copy nevertheless. After all this mess with Qt 5 transition I don't trust Qt in the area of QString from char array.

I rather have here a copy too much, which won't matter, then a potential breakage when going to Qt 6.

REPOSITORY
  R108 KWin

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

To: graesslin, #kwin, #plasma
Cc: anthonyfieroni, fvogt, broulik, plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170802/397a1989/attachment.html>


More information about the Plasma-devel mailing list