From kde-commits Fri Jan 16 13:59:00 2009 From: Roman Jarosz Date: Fri, 16 Jan 2009 13:59:00 +0000 To: kde-commits Subject: branches/KDE/4.2/kdenetwork/kopete/plugins/pipes Message-Id: <1232114340.480073.21475.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=123211435030658 SVN commit 912008 by rjarosz: Backport fix for bug 173195: Pipes plugin doesn't support Unicode. Patch by Sebastian Strand, thanks. CCBUG: 173195 M +12 -12 pipesplugin.cpp M +3 -3 pipesplugin.h --- branches/KDE/4.2/kdenetwork/kopete/plugins/pipes/pipesplugin.cpp #912007:912008 @@ -108,32 +108,32 @@ // poop out appropriate data if ( pipeOptions.pipeContents == HtmlBody ) - pipe.write ( msg.escapedBody().toLocal8Bit() ); + pipe.write ( msg.escapedBody().toUtf8() ); else if ( pipeOptions.pipeContents == PlainBody ) - pipe.write ( msg.plainBody().toLocal8Bit() ); + pipe.write ( msg.plainBody().toUtf8() ); else if ( pipeOptions.pipeContents == Xml ) - pipe.write ( createXml ( msg ).toLocal8Bit() ); + pipe.write ( createXml ( msg ) ); pipe.closeWriteChannel(); pipe.waitForFinished(); - QString pipeReturn = pipe.readAllStandardOutput(); + QByteArray pipeReturn = pipe.readAllStandardOutput(); // set data in message to output of pipe if ( pipeOptions.pipeContents == HtmlBody ) - msg.setHtmlBody ( pipeReturn ); + msg.setHtmlBody ( QString::fromUtf8( pipeReturn ) ); else if ( pipeOptions.pipeContents == PlainBody ) - msg.setPlainBody ( pipeReturn ); + msg.setPlainBody ( QString::fromUtf8( pipeReturn ) ); else if ( pipeOptions.pipeContents == Xml ) readXml ( pipeOptions, msg, pipeReturn ); } -QString PipesPlugin::createXml ( const Kopete::Message & msg ) +QByteArray PipesPlugin::createXml ( const Kopete::Message & msg ) { /* Here's an example of what a pipee will get: - + view()->mainWidget() ? msg.manager()->view()->mainWidget() : Kopete::UI::Global::mainWidget(), --- branches/KDE/4.2/kdenetwork/kopete/plugins/pipes/pipesplugin.h #912007:912008 @@ -94,13 +94,13 @@ * Turn a Message into a QDomDocument, return that XML. * Info for the XML is pulled from all over Kopete. */ - static QString createXml ( const Kopete::Message & ); + static QByteArray createXml ( const Kopete::Message & ); /* - * Take a QString containing XML, take pertinent info from + * Take a QByteArray containing XML, take pertinent info from * that, and put it in the Message. */ - static void readXml ( PipeOptions, Kopete::Message &, const QString & ); + static void readXml ( PipeOptions, Kopete::Message &, const QByteArray & ); private: static PipesPlugin* mPluginStatic;