[Psi-Devel] [BUG] Polish diacritics cannot be used in Compose message dialog

Michał Jazłowiecki michalj at poczta.neostrada.pl
Sat Feb 9 13:57:13 PST 2008


Welcome,


Thanks to the info from one of Polish Psi users I was able to spot a 
newly introduced problem: one cannot type Polish diacritic symbols while 
in Compose message dialog.

Further investigation has shown that the bug was introduced sometime 
between rev.966 and rev.1014. I've found the source of the issue - it 
was introduced by Machekku's patch in rev.1003, which was supposed to 
enable user to use Ctrl and Alt keys in shortcuts.

The faulty line is 98 (as of rev.1014):

	else if ((e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && 
(e->modifiers() & Qt::ControlModifier) || (e->modifiers() & 
Qt::AltModifier)) {

which says

if ((key is Return or key is Enter) and Ctrl is pressed) or Alt is pressed

instead of

if (key is Return or key is Enter) and (Ctrl is pressed or Alt is pressed)

thus requiring an additional pair of parentheses around || operator 
operands, like this:

	else if ((e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && 
((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & 
Qt::AltModifier))) {

The main reason behind the problem was that the code above made all key 
sequences that contained Alt key were ignored and Polish diacritic 
symbols are being input with right Alt key (which is equivalent to Ctrl 
and Alt being pressed together when using Polish programmers' keyboard 
layout).


Kind regards,


-- 
Michał Jazłowiecki (michalj)
Psi Forum & Wiki Moderator



More information about the Psi-Devel mailing list