D7046: Use xcb-icccm to read the name property

Fabian Vogt noreply at phabricator.kde.org
Tue Aug 1 20:17:54 UTC 2017


fvogt added a comment.


  Built and tested - works fine! I only added two rather nitpicky comments.

INLINE COMMENTS

> client.cpp:1428
> +            if (reply.encoding == atoms->utf8_string) {
> +                retVal = QString::fromUtf8(QByteArray(reply.name, reply.name_len));
> +            } else if (reply.encoding == XCB_ATOM_STRING) {

Why not directly `QString::fromUtf8(reply.name, reply.name_len)` here? It would save one unnecessary copy. Alternatively, `QByteArray::fromRawData(reply.name, reply.name_len)`, but that's more verbose.

> client.cpp:1433
> +            xcb_icccm_get_text_property_reply_wipe(&reply);
> +            return retVal;
> +        }

This omits the call to `QString::simplified` that is done in the old rev and for the `info->name()` case. Intentional?

REPOSITORY
  R108 KWin

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

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


More information about the Plasma-devel mailing list