From: Manuel Nickschas Date: Tue, 13 Apr 2010 21:38:22 +0000 (+0200) Subject: Replace tab characters by 8 spaces X-Git-Tag: 0.6.0~5 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=ea5561874b3061cb053a0fb75a58aedc4eb5fdaf Replace tab characters by 8 spaces Our layout engine can't properly handle tabs (and it's doubtful how they should be handled anyway on random pastes), and it breaks while trying. So now we replace tabs by 8 spaces. Note that Konversation (and probably some others) currently sends a \t for the "italics" format. This is non-standard and not very consistent across clients, so I chose to not have a tab trigger italics. So for pastes, we show something mostly correct, while italic text sent from Konversation will cause some whitespace instead. I think that's a better tradeoff than the other way round (showing italics when tabs are pasted). --- diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index f23ec19d..dd2ed961 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -504,6 +504,7 @@ UiStyle::StyledString UiStyle::styleString(const QString &s_, quint32 baseFormat QString UiStyle::mircToInternal(const QString &mirc_) { QString mirc = mirc_; mirc.replace('%', "%%"); // escape % just to be sure + mirc.replace('\t', " "); // tabs break layout, also this is italics in Konversation mirc.replace('\x02', "%B"); mirc.replace('\x0f', "%O"); mirc.replace('\x12', "%R");