[kopete-bugs] [Bug 224091] Preserve multiple whitespaces and whitespaces at the beginning of line

Igor Poboiko igor.poboiko at gmail.com
Mon May 10 02:10:17 CEST 2010


https://bugs.kde.org/show_bug.cgi?id=224091





--- Comment #4 from Igor Poboiko <igor poboiko gmail com>  2010-05-10 02:10:16 ---
First of all, sorry for my bad english, but I hope you will understand all what
I tried to say :)

Kopete uses HTML in chat window. In HTML many whitespaces displays like one
whitespace, so Kopete doesn't display it correctly.
Possible fix is to add tag <PRE> to all displaying messages, or to add
'white-space: pre' to default CSS.
After fixing first problem, Jabber (I tested on it) sends and receives messages
with multiple whitespaces with no problems.

Second problem is in Oscar protocol. The message (I have entered) before
sending is being formatted to some HTML format. Kopete use
QTextDocument::setHtml(), and it trims all multiple whitespaces.
Possible fix is to call QTextDocument::setDefaultStyleSheet() with parameter '*
{ white-space: pre; }' like in first part of this problem.
After fixing it, whitespaces are not ignored in my Oscar messages.

Third problem is history plugin. In logs ($HOME/.kde4/share/apps/kopete/logs)
messages stores with whitespaces, but kopete displays it without it. 
Same problem here - history plugin calls Kopete::Message::setHtmlBody()
(plugins/history/historylogger.cpp, lines 611 and 618), which calls
QTextDocument::setHtml(), which trims all whitespaces.
Possible fix is same - just call setDefaultStyleSheet(), but I don't know where
to do it - in history plugin I can't call this method of Kopete::Message's
QTextDocument because of incapsulation (or can? I can be wrong..)

And see attached patch:)

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the kopete-bugs mailing list