summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2015-04-16 17:43:46 +0200
committerKonstantin Ritt <ritt.ks@gmail.com>2015-04-17 01:08:49 +0000
commit7f82b9258e702fcc1857814c585b1b89d9328006 (patch)
tree82b0b3e7fad781255552eb4ece06918324f6a66c /src/network/access
parenta7303e45dbd1ac37048fb1a907edabe0158b2b52 (diff)
Ensure the UTF-8 string for a xcb_keycode_t has the correct length.
On my platform (Archlinux, libxcb 1.11-1) and a recent build of Qt dev I noticed that writing anything to a QLineEdit was broken, as not only the character for the pressed key was inserted, but also what looks like whitespace. A simple debug program showed that a "\u0000" is appended to every character in the QString text associated with a QKeyEvent, which brought me to QXcbKeyboard::lookupString. The QByteArray to QString conversion using QString::fromUtf8 includes the \x00 byte at the end of the buffer. By leveraging the size returned by the xcb API and passing that to QString::fromUtf8 we can prevent this problem from arising. Change-Id: Ic1d4390e4154e9ed729cd23286811d6eecdf54f6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/network/access')
0 files changed, 0 insertions, 0 deletions