[Bug 117336] Soft word wrap is really necessary

Matt Whitlock matt at whitlock.name
Wed Feb 20 03:50:44 GMT 2008


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=117336         




------- Additional Comments From matt whitlock name  2008-02-20 04:50 -------
Created an attachment (id=23628)
 --> (http://bugs.kde.org/attachment.cgi?id=23628&action=view)
soft-break.patch

I disagree with the reporter's opinion that the current implementation is
adequate for plain-text mail.

Currently we have two options: word wrap at X columns or do not wrap.

The former case behaves correctly (and actually better than most mail clients)
in that What You See Is What You Get in the composer window.  (Kudos.)

The latter case is problematic: the actual mail is sent correctly, but the
QTextEdit widget in the composer window has its wrapping mode set to NoWrap,
which means long lines run right off the edge of the widget and instigate a
horizontal scroll bar.	(Ugly and unusable.)

Simply changing the line wrap mode of the editor to WidgetWidth does not
completely solve the problem because the code that breaks the lines for actual
transmission relies on the editor's wrapping.  So what happens is that the
actually transmitted lines get hard-broken wherever the editor widget put soft
line breaks, which depends on its current graphical width.

Fortunately, the message composer already has a mechanism to suppress the
breaking behavior, although it appears that over the course of several code
revisions, it has become disused.  However, that mechanism could potentially be
invoked when sending a message when the composer's "Word Wrap" option has been
turned off.

The attached patch, therefore, makes the following four changes:
1.) When initially setting up the editor component, set its word wrap mode to
QTextEdit::WidgetWidth instead of QTextEdit::NoWrap if the global word wrap
option is not selected.
2.) When toggling the local word wrap mode (from the Options menu in the
composer window), switch the editor's word wrap mode to QTextEdit::WidgetWidth
instead of QTextEdit::NoWrap when deselecting word wrap.
3.) When copying parameters from the composer window to the message composer,
do not force the mDisableBreaking flag to false.
4.) Instead, set the mDisableBreaking flag iff the composer window's editor
component's word wrap mode is QTextEdit::WidgetWidth.



More information about the Kdepim-bugs mailing list