summaryrefslogtreecommitdiffabout
path: root/kabc
Side-by-side diff
Diffstat (limited to 'kabc') (more/less context) (show whitespace changes)
-rw-r--r--kabc/addresseeview.cpp40
1 files changed, 38 insertions, 2 deletions
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp
index 8f104e0..aa96210 100644
--- a/kabc/addresseeview.cpp
+++ b/kabc/addresseeview.cpp
@@ -261,2 +261,36 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee )
} else {
+ if ( !mAddressee.custom( "KADDRESSBOOK", "X-Children" ).isEmpty() ) {
+ static bool setDefaultImageChildren = false;
+ if ( !setDefaultImageChildren ) {
+ QMimeSourceFactory::defaultFactory()->setPixmap( "familyIcon", KGlobal::iconLoader()->loadIcon( "ic_kids", KIcon::Desktop, 128 ) );
+ setDefaultImageChildren = true;
+ }
+ picString = "<img src=\"familyIcon\" width=\"64\" height=\"64\">";
+
+ } else if ( !mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ).isEmpty() ) {
+ static bool setDefaultImagepouses = false;
+ if ( !setDefaultImagepouses ) {
+ QMimeSourceFactory::defaultFactory()->setPixmap( "SpousesIcon", KGlobal::iconLoader()->loadIcon( "ic_family", KIcon::Desktop, 128 ) );
+ setDefaultImagepouses = true;
+ }
+ picString = "<img src=\"SpousesIcon\" width=\"64\" height=\"64\">";
+ } else {
+ QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" );
+ if ( gen == "male" ) {
+ static bool setDefaultImageMale = false;
+ if ( !setDefaultImageMale ) {
+ QMimeSourceFactory::defaultFactory()->setPixmap( "MaleIcon", KGlobal::iconLoader()->loadIcon( "ic_male", KIcon::Desktop, 128 ) );
+ setDefaultImageMale = true;
+ }
+ picString = "<img src=\"MaleIcon\" width=\"64\" height=\"64\">";
+
+ } else if ( gen == "female" ) {
+ static bool setDefaultImageFemale = false;
+ if ( !setDefaultImageFemale ) {
+ QMimeSourceFactory::defaultFactory()->setPixmap( "FemaleIcon", KGlobal::iconLoader()->loadIcon( "ic_female", KIcon::Desktop, 128 ) );
+ setDefaultImageFemale = true;
+ }
+ picString = "<img src=\"FemaleIcon\" width=\"64\" height=\"64\">";
+
+ } else {
static bool setDefaultImage = false;
@@ -264,6 +298,8 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee )
qDebug("Setting default pixmap ");
- QMimeSourceFactory::defaultFactory()->setPixmap( "defaultPenguin", KGlobal::iconLoader()->loadIcon( "package_toys", KIcon::Desktop, 128 ) );
+ QMimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) );
setDefaultImage = true;
}
- picString = "<img src=\"defaultPenguin\" width=\"64\" height=\"64\">";
+ picString = "<img src=\"defaultIcon\" width=\"64\" height=\"64\">";
+ }
+ }
}