Remove useless truncation to the size the string already has

Caused by the refactor in 05351b0cde3e80d2d0ae3a838e802ff6086e4b59.

The count was probably wrong in the creation of the QKeyEvent, so this
commit keeps it wrong.

Change-Id: I049a653beeb5454c9539ffff13e573bba826e927
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
This commit is contained in:
Thiago Macieira 2015-06-07 14:15:06 +02:00
parent 5ca4cab712
commit 861cbef49f

View File

@ -1473,8 +1473,6 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
}
QString string = lookupString(xkb_state, code);
int count = string.size();
string.truncate(count);
// Ιf control modifier is set we should prefer latin character, this is
// used for standard shortcuts in checks like "key == QKeySequence::Copy",
@ -1506,7 +1504,7 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
bool filtered = false;
if (inputContext) {
QKeyEvent event(type, qtcode, modifiers, code, sym, state, string, isAutoRepeat, count);
QKeyEvent event(type, qtcode, modifiers, code, sym, state, string, isAutoRepeat, string.length());
event.setTimestamp(time);
filtered = inputContext->filterEvent(&event);
}
@ -1535,7 +1533,7 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
}
if (!filtered && inputContext) {
QKeyEvent event(QEvent::KeyPress, qtcode, modifiers, code, sym, state, string, isAutoRepeat, count);
QKeyEvent event(QEvent::KeyPress, qtcode, modifiers, code, sym, state, string, isAutoRepeat, string.length());
event.setTimestamp(time);
filtered = inputContext->filterEvent(&event);
}