aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/tcime/plugin/tcinputmethod.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-18 23:03:17 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-07-19 09:07:49 +0200
commit68375389bf09427103ab3ff2b7fb1517e9b55615 (patch)
tree3d54e974591ae0a5b2142254e12e24c85973764b /src/plugins/tcime/plugin/tcinputmethod.cpp
parent1de3b00963d1fb55e732893fad5005c998280792 (diff)
Port from implicit QChar(*int*) to explicit ones
Found a nice misuse of QChar <=> Qt::Key, which happens to work for '\'', but not for all other keys (e.g. Esc)... I want to note that, yes, I took note of the code's abuse of Qt containers, and no, I _did_ constrain myself; this patch is just fixing implicit *int*->QChar conversions. Change-Id: I3cb43417f3922fdc500783b7e0b8caecc0d3c5f5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/tcime/plugin/tcinputmethod.cpp')
-rw-r--r--src/plugins/tcime/plugin/tcinputmethod.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/tcime/plugin/tcinputmethod.cpp b/src/plugins/tcime/plugin/tcinputmethod.cpp
index abbbdd36..1f5fc6e3 100644
--- a/src/plugins/tcime/plugin/tcinputmethod.cpp
+++ b/src/plugins/tcime/plugin/tcinputmethod.cpp
@@ -124,7 +124,7 @@ public:
bool composeCangjie(QVirtualKeyboardInputContext *ic, const QChar &c)
{
bool accept = false;
- if (!input.contains(0x91CD) && CangjieTable::isLetter(c)) {
+ if (!input.contains(QChar(0x91CD)) && CangjieTable::isLetter(c)) {
if (input.length() < (cangjieDictionary.simplified() ? CangjieTable::MAX_SIMPLIFIED_CODE_LENGTH : CangjieTable::MAX_CODE_LENGTH)) {
input.append(c);
ic->setPreeditText(input);
@@ -260,7 +260,7 @@ public:
QList<QChar> decomposeZhuyin()
{
- QList<QChar> results = QList<QChar>() << 0 << 0 << 0 << 0;
+ QList<QChar> results = {QChar::Null, QChar::Null, QChar::Null, QChar::Null};
QStringList pair = ZhuyinTable::stripTones(input);
if (!pair.isEmpty()) {
// Decompose tones.