Bug 141654 - kmail: window title unreadable after pasting newline to subject
Summary: kmail: window title unreadable after pasting newline to subject
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-13 21:24 UTC by Sune Vuorela
Modified: 2007-02-15 00:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Proposed patch (541 bytes, patch)
2007-02-13 21:26 UTC, Sune Vuorela
Details

Note You need to log in before you can comment on or make changes to this bug.
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'), ' ' ) );
 }