summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/vcardformatimpl.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp
index 26fd4f0..580c28b 100644
--- a/kabc/vcardformatimpl.cpp
+++ b/kabc/vcardformatimpl.cpp
@@ -855,2 +855,3 @@ Agent VCardFormatImpl::readAgentValue( VCARD::ContentLine *cl )
+#include <qstringlist.h>
void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType type, const Picture &pic, const Addressee &addr, bool intern )
@@ -859,3 +860,3 @@ void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType ty
cl.setName( EntityTypeToParamName( type ) );
-
+ // qDebug( "IIIMMMMM %s",QImage::outputFormatList ().join("-").latin1() );
if ( pic.isIntern() && pic.data().isNull() )
@@ -875,3 +876,5 @@ void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType ty
cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) );
-
+ params.append( new Param( "ENCODING", "b" ) );
+ if ( !pic.type().isEmpty() )
+ params.append( new Param( "TYPE", pic.type().utf8() ) );
} else { // save picture in cache
@@ -882,9 +885,10 @@ void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType ty
dir = "logos";
-
- img.save( locateLocal( "data", "kabc/" + dir + "/" + addr.uid() ), pic.type().utf8() );
- cl.setValue( new TextValue( "<dummy>" ) );
+ QString imUrl = locateLocal( "data", "kabc/" + dir + "/" + addr.uid() );
+ KABC::Picture* ppic =(KABC::Picture*) &pic;
+ ppic->setUrl( imUrl );
+ img.save(imUrl, "PNG" );
+ cl.setValue( new TextValue( pic.url().utf8() ) );
+ params.append( new Param( "VALUE", "uri" ) );
}
- params.append( new Param( "ENCODING", "b" ) );
- if ( !pic.type().isEmpty() )
- params.append( new Param( "TYPE", pic.type().utf8() ) );
+
} else {