OSDN Git Service

simplify QKeyMapper::clearMappings() and do not use the cached locale codec
authorIvailo Monev <xakepa10@gmail.com>
Sun, 20 Nov 2022 20:50:33 +0000 (22:50 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 20 Nov 2022 21:03:07 +0000 (23:03 +0200)
commit431e81946b78305b6927057302f52420e4749794
treefe29256a510b935133778472b0cd33ee12db37e3
parentd7676fe5a890af3c190f003ab4d1960a5e37f000
simplify QKeyMapper::clearMappings() and do not use the cached locale codec

since it is known what locale the X11 input method uses it is redundant to
verify that via XLocaleOfIM() (unless X11 fails to detect what locale is
set for some strange reason).

also not using the cached codec returned by QTextCodec::codecForLocale()
because the locale may change at any time (either environment variable
change or just plain setlocale() call as was done by KCatalog as gettext
workaround) and QKeyMapper has to reflect such changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/codecs/qtextcodec.cpp
src/core/codecs/qtextcodec_p.h
src/core/tools/qstring.cpp
src/gui/kernel/qkeymapper_x11.cpp