Bug 141654

Summary: kmail: window title unreadable after pasting newline to subject
Product: [Applications] kmail Reporter: Sune Vuorela <debian>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Proposed patch

Description Sune Vuorela 2007-02-13 21:24:43 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Debian testing/unstable Packages

Originally sent as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=334956

In many window decorations, the a newline in the title line is shown as a newline.  When pasting something with newlines in the subject line of a email, this string with newlines are shown in the title line of the composer window.

As it is only some window decorations that shows this behaviour, I think it can be fixed in the window decorations, but most of the window decorations I have installed does show this behaviour. I think it would be easiest to fix it in kmail and to have it do a s/\n/ / before setting the title line.

A patch to this will be attached quickly.

The debian bugreport contains a couple of screenshots.

/Sune
Comment 1 Sune Vuorela 2007-02-13 21:26:02 UTC
Created attachment 19677 [details]
Proposed patch
Comment 2 groot 2007-02-15 00:23:54 UTC
SVN commit 633713 by adridg:

Since newlines display as blocks, remove them from a possible caption before display.
Patch credits to pusling.
BUG:141654


 M  +5 -2      branches/work/kdepim-3.5.5+/kmail/kmcomposewin.cpp  


--- branches/work/kdepim-3.5.5+/kmail/kmcomposewin.cpp #633712:633713
@@ -3594,9 +3594,12 @@
 //-----------------------------------------------------------------------------
 void KMComposeWin::slotUpdWinTitle(const QString& text)
 {
+  QString s( text );
+  // Remove characters that show badly in most window decorations:
+  // newlines tend to become boxes.
   if (text.isEmpty())
-       setCaption("("+i18n("unnamed")+")");
-  else setCaption(text);
+    setCaption("("+i18n("unnamed")+")");
+  else setCaption( s.replace( QChar('\n'), ' ' ) );
 }