Logo Search packages:      
Sourcecode: kdenetwork version File versions

void KopeteMessage::setBody ( const QString &  body,
MessageFormat  format = PlainText 

Sets the body of the message.

body The body
format The format of the message,
See also:

Definition at line 240 of file kopetemessage.cpp.

References detach().

Referenced by NowListeningPlugin::slotOutgoingMessage().


      QString theBody = body;
      if( f == RichText )
            //This is coming from the RichTextEditor component.
            //Strip off the containing HTML document
            theBody.replace( QRegExp( QString::fromLatin1(".*<body.*>\\s+(.*)\\s+</body>.*") ), QString::fromLatin1("\\1") );

            //Strip <p> tags
            theBody.replace( QString::fromLatin1("<p>"), QString::null );

            //Replace </p> with a <br/>
            theBody.replace( QString::fromLatin1("</p>"), QString::fromLatin1("<br/>") );

            //Remove trailing </br>
            if ( theBody.endsWith( QString::fromLatin1("<br/>") ) )
                  theBody.truncate( theBody.length() - 5 );

            theBody.remove( QString::fromLatin1("\n") );

      d->format = f;

Generated by  Doxygen 1.6.0   Back to index