[prev in list] [next in list] [prev in thread] [next in thread]
List: kopete-devel
Subject: [kopete-devel] kdenetwork/kopete
From: Jason Keirstead <jason () keirstead ! org>
Date: 2005-02-17 20:56:54
Message-ID: 20050217205654.738CE1BA33 () office ! kde ! org
[Download RAW message or body]
CVS commit by brunes:
Embed the user photo directly into the HTML. This should appease Gof and me both. \
Performance seems ot be fine from my experience.
CCMAIL: kopete-devel@kde.org
M +7 -7 libkopete/kopetemessage.cpp 1.181
M +3 -3 styles/iChat.xsl 1.5
--- kdenetwork/kopete/libkopete/kopetemessage.cpp #1.180:1.181
@@ -20,4 +20,5 @@
#include <qcolor.h>
+#include <qbuffer.h>
#include <qimage.h>
#include <qstylesheet.h>
@@ -28,6 +29,5 @@
#include <kiconloader.h>
#include <kstringhandler.h>
-#include <kstandarddirs.h>
-#include <ktempfile.h>
+#include <kmdcodec.h>
#include "kopetemessage.h"
@@ -64,5 +64,4 @@ public:
QDateTime timeStamp;
QFont font;
- KTempFile photoFile;
QColor fgColor;
@@ -510,8 +509,9 @@ QDomElement Message::contactNode( QDomDo
if( !photo.isNull() )
{
- d->photoFile = KTempFile( locateLocal("tmp", \
QString::fromLatin1("tmpimage-")), QString::fromLatin1("png") );
- d->photoFile.setAutoDelete( true );
- photo.save ( d->photoFile.name(), "PNG" );
- contactNode.setAttribute( QString::fromLatin1("userPhoto"), \
QStyleSheet::escape( d->photoFile.name() ) ); + QByteArray ba;
+ QBuffer buffer( ba );
+ buffer.open( IO_WriteOnly );
+ photo.save ( &buffer, "PNG" );
+ contactNode.setAttribute( QString::fromLatin1("userPhoto"), \
KCodecs::base64Encode(ba) ); }
}
--- kdenetwork/kopete/styles/iChat.xsl #1.4:1.5
@@ -56,5 +56,5 @@
<xsl:when test="from/contact/@userPhoto">
<img \
style="height:48px;margin:4px;margin-bottom:0px;border:1px solid \
black;">
- <xsl:attribute name="src"><xsl:value-of \
select="from/contact/@userPhoto"/></xsl:attribute> + \
<xsl:attribute name="src">data:image/png;base64,<xsl:value-of \
select="from/contact/@userPhoto"/></xsl:attribute> </img>
</xsl:when>
@@ -396,5 +396,5 @@
<xsl:when test="from/contact/@userPhoto">
<img \
style="height:48px;margin:4px;margin-bottom:0px;border:1px solid \
black;">
- <xsl:attribute name="src"><xsl:value-of \
select="from/contact/@userPhoto"/></xsl:attribute> + \
<xsl:attribute name="src">data:image/png;base64,<xsl:value-of \
select="from/contact/@userPhoto"/></xsl:attribute> </img>
</xsl:when>
@@ -554,5 +554,5 @@
<xsl:when test="from/contact/@userPhoto">
<img \
style="height:48px;margin:4px;margin-bottom:0px;;border:1px solid \
black;">
- <xsl:attribute name="src"><xsl:value-of \
select="from/contact/@userPhoto"/></xsl:attribute> + \
<xsl:attribute name="src">data:image/png;base64,<xsl:value-of \
select="from/contact/@userPhoto"/></xsl:attribute> </img>
</xsl:when>
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic