[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE_3_1_BRANCH: kdenetwork/ksirc
From: Simon Hausmann <hausmann () kde ! org>
Date: 2002-12-13 22:40:30
[Download RAW message or body]
CVS commit by hausmann:
- explicitly separate the <nick> from the message in terms of the markup,
to prevent the line being drawn in one set and causing a possible
re-ordering breakage, as reported by UV Kochavi <uv1st@yahoo.com>, who
also had the idea
M +15 -1 ksview.cpp 1.64.2.1
--- kdenetwork/ksirc/ksview.cpp #1.64:1.64.2.1
@@ -280,4 +280,18 @@ QString KSircView::addLine(const QString
text.replace(gtRex, ">");
+ // ### a bit of a hack: turn '<nick> message' into
+ // <span><nick><span> message' . span itself isn't supported but it
+ // enforces the creation of separate item objects and hence separate
+ // drawing of '<nick>' and 'message' , which is needed for BiDi users,
+ // according to UV Kochavi <uv1st@yahoo.com> , to prevent output like
+ // '<nick message<' , which is supposedly a bug in Qt's reordering. The
+ // same is done for [nick] and >nick< to catch queries.
+ QRegExp bidiRe( "^(<\\S+>)(.+)$" );
+ text.replace( bidiRe, QString::fromLatin1( "<span>\\1</span>\\2" ) );
+ QRegExp bidiRe2( "^(\\[\\S+\\])(.+)$" );
+ text.replace( bidiRe2, QString::fromLatin1( "<span>\\1</span>\\2" ) );
+ QRegExp bidiRe3( "^(>\\S+<)(.+)$" );
+ text.replace( bidiRe3, QString::fromLatin1( "<span>\\1</span>\\2" ) );
+
KSParser parser;
richText += parser.parse( text );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic