[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/libkopete
From:       Roman Jarosz <kedgedev () centrum ! cz>
Date:       2009-01-31 23:40:43
Message-ID: 1233445243.547188.7306.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 919432 by rjarosz:

Remove ObjectReplacementCharacter character because if we call setHtml with it then \
the html will be empty. Fixes bug when empty messages were shown in chat and history \
window.

BUG: 177442
CCBUG: 182114



 M  +9 -2      kopetemessage.cpp  
 M  +1 -1      kopetemessage.h  


--- trunk/KDE/kdenetwork/kopete/libkopete/kopetemessage.cpp #919431:919432
@@ -243,8 +243,12 @@
 	doSetBody (body, Qt::RichText);
 }
 
-void Message::doSetBody (const QString &body, Qt::TextFormat f)
+void Message::doSetBody (QString body, Qt::TextFormat f)
 {
+	// Remove ObjectReplacementCharacter because otherwise html text will be empty
+	if ( body.contains( QChar( QChar::ObjectReplacementCharacter ) ) )
+		body.replace( QChar( QChar::ObjectReplacementCharacter ), QChar( ' ' ) );
+
 	if (f == Qt::PlainText)
 		d->body->setPlainText(body);
 	else
@@ -357,7 +361,10 @@
 
 QString Message::plainBody() const
 {
-	return d->body->toPlainText();
+	// Remove ObjectReplacementCharacter which can be there if html text contains img \
tag. +	QString plainText = d->body->toPlainText();
+	plainText.replace( QChar( QChar::ObjectReplacementCharacter ), QChar( ' ' ) );
+	return plainText;
 }
 
 QString Message::escapedBody() const
--- trunk/KDE/kdenetwork/kopete/libkopete/kopetemessage.h #919431:919432
@@ -545,7 +545,7 @@
 	 * Basically @ref setBody() without detach
 	 * @internal
 	 */
-	void doSetBody( const QString &body, Qt::TextFormat format = Qt::PlainText );
+	void doSetBody( QString body, Qt::TextFormat format = Qt::PlainText );
 
 	/**
 	 * Called internally by @ref setBody() and the constructor


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic