Bug 163609

Summary: Wordwrap breaks up URLs with dashes ('-')
Product: [Applications] kmail2 Reporter: René Krell <renda.krell>
Component: composerAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: aacid, bendj095124367913213465, bernhard, bluedzins, bugs.kde, bugs, bugzilla-kde, cyberbeat, georg.bendemann, gerd, gronslet, hanno, kde-bugs-68795, kde.org, kde, kollix, luigi.toscano, matija, maurice, montel, renda.krell, romanocaldoni, shlomif, suse-linux
Priority: NOR    
Version: 4.8.4   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
See Also: https://bugreports.qt-project.org/browse/QTBUG-7215
https://bugs.kde.org/show_bug.cgi?id=271000
Latest Commit: Version Fixed In: 4.9.2
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 209030    

Description René Krell 2008-06-09 14:43:57 UTC
Version:           1.9.51 (using Devel)
Installed from:    Compiled sources
Compiler:          gcc 4.3 
OS:                Linux

As a default setting, composer has the Otions->Wordwrap = On. With this setting, if I enter an URL with dashes longer than the number of characters per line, the URL is broken up after the dash ('-') as a normal word.

I don't know any way to avoid this than ecah time explicitely switch Wordwrap = Off in composer when writing a new mail. The previous kmail from KDE3 did not have such a behaviour, did it?
Comment 1 Thomas McGuire 2008-06-10 17:05:19 UTC
Note that wordwrapping is done on QTextEdit, so this is probably a Qt problem.
Comment 2 René Krell 2008-06-25 14:21:27 UTC
Alright, good to know, but can't you contact the Qt development team to declare that on an expert-to-expert level, please?
May be for Qt developers this is normal and they won't change this behaviour and the developer using Qt has to put a workaround for this into the application. I'm really not qualified to discuss this on this level at the moment :-)

Simply testing and not developing KMail, it comes up in KMail ;-) To this time I haven't been  faced with a bad wordwrapping in another application.
Comment 3 René Krell 2008-10-07 10:49:38 UTC
Ok, tried this another time and seems to be fixed.
Tested with
- KDE 4.1.2
- KMail 1.10.1
- Qt 4.4.3
from the OpenSUSE 11.0 repositories.
Comment 4 Thomas McGuire 2008-12-05 17:02:28 UTC
*** Bug 176435 has been marked as a duplicate of this bug. ***
Comment 5 Ronny Multrus 2008-12-17 12:15:55 UTC
I can confirm this very annoying bug on Gentoo with KDE 4.1.3 and Qt 4.4.2. I can't check Qt 4.4.3 at the moment as it's not yet in portage...
Comment 6 Jaime Torres 2009-01-10 23:45:11 UTC
*** Bug 180259 has been marked as a duplicate of this bug. ***
Comment 7 Gerd v. Egidy 2009-01-12 15:15:43 UTC
I can confirm this bug with KDE 4.1.3, Qt 4.4.3 and Kmail 1.10.3 from Fedora 9 i386.

So if this is fixed in OpenSuse 11 this has maybe been forward-ported by OpenSuse?
Comment 8 René Krell 2009-01-12 15:25:06 UTC
Yes, it is still there for 4.1.87 (upcoming 4.2), too. Long URLs with dashes are broken as normal text when having Wordwrap on, Qt word wrapping doesn't recognize them in the composer text.
Comment 9 René Krell 2009-01-12 15:31:42 UTC
@Gerd: ... This is not really fixed in OpenSUSE, this was a mistake or a short-term state. OpenSuSE 11.1 uses still Qt 4.4.3 in its latest 4.1.87 packages from the KDE Factory, with the same problem as described in this report.
Comment 10 Gerd v. Egidy 2009-01-12 17:34:18 UTC
Hi René, thanks for looking into this. Do you happen to know if there are plans to improve the Qt word wrapping in a future version? Should we file a bug/feature whish for Qt?
Or do you think it is better to add some kind of wrapper around the Qt word-wrapping which handles cases like this?
Comment 11 Shlomi Fish 2009-01-31 17:25:40 UTC
Can confirm this bug here on KDE 4.2.0's KMail running on Mandriva Linux Cooker . Very annoying.

Comment 12 René Krell 2009-02-02 10:16:17 UTC
(In reply to comment #10)
> Hi René, thanks for looking into this. Do you happen to know if there are
> plans to improve the Qt word wrapping in a future version? Should we file a
> bug/feature whish for Qt?
> Or do you think it is better to add some kind of wrapper around the Qt
> word-wrapping which handles cases like this?
> 

Hi Gerd, I do not have any idea what's the best address for this issue, I'm not familar with neither KDE nor Qt programming and leave the decision on experts.
Comment 13 René Krell 2009-03-17 10:15:22 UTC
Update: The problem still exists in version 1.11.1 (KDE 4.2.1 / openSUSE_11.1 / x86_64) using Qt 4.5.
Comment 14 Bernd Wurst 2009-03-30 13:23:27 UTC
Please, someone could set the state of this bug to something other than "UNCONFIRMED". It's there and it's annoying.

To make this clear: KMail of KDE 3 did not have this, it's only the KDE 4 versions.
Comment 15 alteo_gange 2009-03-30 13:32:04 UTC
I agree with Bernd.
Comment 16 Jaime Torres 2009-06-29 11:34:48 UTC
*** Bug 198264 has been marked as a duplicate of this bug. ***
Comment 17 Martin Koller 2009-08-23 22:07:28 UTC
*** Bug 177192 has been marked as a duplicate of this bug. ***
Comment 18 Martin Koller 2009-08-23 22:08:15 UTC
*** Bug 148652 has been marked as a duplicate of this bug. ***
Comment 19 Martin Koller 2009-08-24 21:43:53 UTC
I issued this problem to the task tracker of Qt/Nokia
Comment 20 ancow 2009-08-26 21:58:17 UTC
(In reply to comment #19)
> I issued this problem to the task tracker of Qt/Nokia

Is it possible to provide a link to the Qt/Nokia task tracker, or is that a private tracker?
Comment 21 Maciej Pilichowski 2009-08-26 22:02:53 UTC
Last time I checked -> private.
Comment 22 Martin Koller 2009-08-26 22:25:18 UTC
It's not private, but I haven't got a reply from them up till now, so I have no issue number.
The Task Tracker can be found at: http://qt.nokia.com/developer/task-tracker
Comment 23 Martin Koller 2009-10-01 21:56:47 UTC
Here is the mail exchanged with Qt-Support [Issue N260387]:

Hi,

On Monday, 24. Aug 2009 21:42 kollix@aon.at wrote:
> regression in WordWrap AtWordBoundary
> Steps to reproduce / test case
> Looking at a bug report in KDE4/kmail regarding word wrapping when
> pasting long URLs, I found the following compatibility problem.
> In Qt3 with QTextEdit and setWrapPolicy(QTextEdit::AtWordBoundary)
> the text was not wrapped at "-" characters, which is good.
> In Qt4 even with the Q3 compatibility class Q3TextEdit, the behavior
> is different and text is wrapped at "-" characters. The same is true
> for Qt4's QTextEdit widget.
>
> How can we solve the problem of not being able to paste long URLs but
> still use word wrapping in the way it worked with Qt3 ?
>
> See also https://bugs.kde.org/show_bug.cgi?id=163609
> More information

This is because the UnicodeTables and harfbuzz recognize a "-" as a soft hyphen ie a word break. If you look at a contribution to add this feature to
                                src/gui/text/qtextlayout.cpp
then we will seek to add that feature for a future release of Qt for Linx.
Comment 24 François Rey 2009-10-16 10:31:15 UTC
So what's the status of this? Bug says it's RESOLVED but I still have it on KMail 1.12.2, KDE 4.3.2, Arch Linux x86_64

You have my votes and encouragement to get this fixed!
Comment 25 Martin Koller 2009-10-16 16:33:53 UTC
It's status is Resolved/upstream, which means it's a restriction inside Qt.
As long as nobody creates a patch which will be accepted by Nokia/Qt, we can not fix that issue.
Comment 26 François Rey 2009-10-16 16:41:25 UTC
Is there an upstream bug entry for this issue we can look at and perhaps vote for?
Comment 27 Martin Koller 2009-10-19 10:00:00 UTC
No, they did not give me an issue number. Probably it was not entered as "defect".
The query was handled with the support Issue N260387
Comment 28 Georg Bendemann 2009-12-03 19:46:41 UTC
Bug reappears in KDE 4.3.4 (release 2), Kmail 1.12.4 (with Opensuse 11.2).

Please contact me for further informations or if it is neccesary to create a new bug report.
Comment 29 ancow 2009-12-03 20:12:50 UTC
If you read the comments to this report, you'll notice that it is a bug in QT, not KDE. No re-appearing or anything - it has just not been fixed yet.
Comment 30 Al Bogner 2009-12-03 20:15:08 UTC
So how can the responsible people be contacted to solve this annoying thing?
Comment 31 Georg Bendemann 2009-12-03 20:21:26 UTC
@ reini

Okay. I don't understand these technical issues. I just reported these bug a few months ago and my report was marked as duplicated. And the problem was really gone for a while (Mandriva and Kubuntu).

So why don't the mantainer switch this bug from resolved to unsolved?
Comment 32 Torgny Nyblom 2009-12-03 20:37:12 UTC
(In reply to comment #31)
> Okay. I don't understand these technical issues. I just reported these bug a
> few months ago and my report was marked as duplicated. And the problem was
> really gone for a while (Mandriva and Kubuntu).

They probably included a patch for this issue in there Qt packages.

> So why don't the mantainer switch this bug from resolved to unsolved?

Because from a KDE perspective the bug solved. But if you look at comment #22 you will see a link to the Qt issue report.
Comment 33 Shlomi Fish 2010-01-07 17:36:27 UTC
(In reply to comment #32)
> (In reply to comment #31)
> > Okay. I don't understand these technical issues. I just reported these bug a
> > few months ago and my report was marked as duplicated. And the problem was
> > really gone for a while (Mandriva and Kubuntu).
> 
> They probably included a patch for this issue in there Qt packages.
> 
> > So why don't the mantainer switch this bug from resolved to unsolved?
> 
> Because from a KDE perspective the bug solved. But if you look at comment #22
> you will see a link to the Qt issue report.

There is none. There is only a link to the task manager in general. Until there is a link to the Qt bug (which isn't fixed as of Qt-4.6.0) where we can comment on this, this bug is not closed. We're still affected by this bug. Re-opening.
Comment 34 Martin Koller 2010-01-07 17:56:06 UTC
I entered the same information now again into the new Qt bugtracker.
You can follow it here:
http://bugreports.qt.nokia.com/browse/QTBUG-7215
Comment 35 H.H. 2010-03-07 15:34:37 UTC
would it be possible to fix this in kde's "qt-copy"?
Comment 36 Thomas McGuire 2010-08-31 17:39:58 UTC
*** Bug 249474 has been marked as a duplicate of this bug. ***
Comment 37 Matija Šuklje 2010-11-18 00:05:11 UTC
This *is* a very annoying bug and one of the very few blemishes KMail has …even Thunderbird and Mutt can handle URLs.

Sad news: upstream doesn't seem to concerned about this bug (link in Comment #34), because it's marked it as "solved" "out of scope".

IMHO if upstream doesn't consider it a bug, it becomes a KDE bug, since a bug it clearly is!
Comment 38 H.H. 2010-11-18 00:23:32 UTC
yes, this bug should be reopened, and there should be a workaround in kde/kmail then, or there should be a fixed qt officially delivered by kde.
Comment 39 Bernhard E. Reiter 2011-01-04 17:33:58 UTC
I've added another comment to http://bugreports.qt.nokia.com/browse/QTBUG-7215 .
If there is no reaction, I guess somebody should file this with other channels
in the Qt developers community or clone the issue so it gets reconsidered.
Comment 40 Thomas McGuire 2011-01-04 19:49:07 UTC
> If there is no reaction, I guess somebody should file this with other channels
> in the Qt developers community or clone the issue so it gets reconsidered.

Please don't clone the issue, that will just add more noise for the developers. The only thing we can do is submit a patch to Qt at this point.
Comment 41 H.H. 2011-01-04 23:15:47 UTC
patching qt seems the right thing to do now. isn't there a thing called "qt copy", which is a patched qt for kde? distributions could ship that then.
Comment 42 Bernhard E. Reiter 2011-01-05 09:42:47 UTC
@Thomas: As as Qt community member, I have to clone the issue, if I continue to have a problem and the close one is not looked at. At least it looks like the only path I know, unless you suggest a better one. :) Possibly contributing a patch is a second step, first the fight is about recognising that there is an issue with Qt and thus have an open report in the tracker about it.

@H.H: Upstream indicated they are open towards a patch in their tracker, so if somebody wants to develop a patch, we should submit it with them. (Possibly in a new issue, refering to the old now closed one.)
Comment 43 Maurice Batey 2011-05-15 17:46:26 UTC
I also am suffering from this problem of URL's being split at "-".

This bug was reported more than 2 YEARS ago, and it's still present in Kmail 1.13.5 (running under KDE 4.5.2 on Mandriva 2010.2).

Anyone who can at last get this fixed will be doing a great service for Kmail users - whether it be a Qt fix or a workaround in KMail.

Please?!
Comment 44 Laurent Montel 2012-09-04 05:34:55 UTC
fixed in 4.9.2
Comment 45 Khumba 2013-06-15 01:03:27 UTC
Not fixed in 4.10.3.
Comment 46 Khumba 2013-06-15 01:07:30 UTC
Oops, disregard.  Sorry for the noise.  Breaks in the editor but not in sent emails.