Bug 107032

Summary: Inserting characters in subject line moves cursor to EOL
Product: knode Reporter: Andreas Schallenberg <Andreas.Schallenberg>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 0.9.1   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Andreas Schallenberg 2005-06-08 14:05:31 UTC
Version:           0.9.1 (using KDE 3.4.1 Level "a" , SUSE 9.2 UNSUPPORTED)
Compiler:          gcc version 3.3.4 (pre 3.3.5 20040809)
OS:                Linux (i686) release 2.6.8-24.14-default

To reproduce:

Start Kontact, select Knode, begin creating a new message.
Place cursor in subject line and type "ab". Use cursor left
key to move cursor between the two characters.
Type "cd". Subject line now reads "acbd" and not "acdb".
Comment 1 Volker Krause 2005-06-18 16:54:06 UTC
SVN commit 426778 by vkrause:

Fix regression of my fix for #104788: Don't change cursor position in
subject field.

CCBUG: 107032


 M  +2 -1      kncomposer.cpp  


--- trunk/KDE/kdepim/knode/kncomposer.cpp #426777:426778
@@ -1427,7 +1427,8 @@
   QString subject = t;
   subject.replace( '\n', ' ' );
   subject.replace( '\r', ' ' );
-  v_iew->s_ubject->setText( subject );
+  if ( subject != t ) // setText() sets the cursor to the end
+    v_iew->s_ubject->setText( subject );
   // update caption
   if( !subject.isEmpty() )
     setCaption( subject );
Comment 2 Volker Krause 2005-06-18 17:01:28 UTC
SVN commit 426781 by vkrause:

Backport from trunk for KDE 3.4.2:
Fix regression of my fix for #104788: Don't change cursor position in
subject field.

BUG: 107032


 M  +2 -1      kncomposer.cpp  


--- branches/KDE/3.4/kdepim/knode/kncomposer.cpp #426780:426781
@@ -1427,7 +1427,8 @@
   QString subject = t;
   subject.replace( '\n', ' ' );
   subject.replace( '\r', ' ' );
-  v_iew->s_ubject->setText( subject );
+  if ( subject != t ) // setText() sets the cursor to the end
+    v_iew->s_ubject->setText( subject );
   // update caption
   if( !subject.isEmpty() )
     setCaption( subject );