summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-29 19:00:52 (UTC)
committer zautrix <zautrix>2005-03-29 19:00:52 (UTC)
commitd6e5d0b71d6a6727fbfef895a814e046a2a99aae (patch) (side-by-side diff)
tree2bc757ab32fda4a2c1b4ad78cc99621ef3466415
parentb70d9695bb6a2d567b75965c0530792ad90c84a3 (diff)
downloadkdepimpi-d6e5d0b71d6a6727fbfef895a814e046a2a99aae.zip
kdepimpi-d6e5d0b71d6a6727fbfef895a814e046a2a99aae.tar.gz
kdepimpi-d6e5d0b71d6a6727fbfef895a814e046a2a99aae.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addresseeview.cpp48
-rw-r--r--kaddressbook/kabcore.cpp2
2 files changed, 43 insertions, 7 deletions
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp
index 8f104e0..aa96210 100644
--- a/kabc/addresseeview.cpp
+++ b/kabc/addresseeview.cpp
@@ -259,13 +259,49 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee )
if ( picAvailUrl ) {
QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", QPixmap( picture.url() ));
} else {
- static bool setDefaultImage = false;
- if ( !setDefaultImage ) {
- qDebug("Setting default pixmap ");
- QMimeSourceFactory::defaultFactory()->setPixmap( "defaultPenguin", KGlobal::iconLoader()->loadIcon( "package_toys", KIcon::Desktop, 128 ) );
- setDefaultImage = true;
+ 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;
+ if ( !setDefaultImage ) {
+ qDebug("Setting default pixmap ");
+ QMimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) );
+ setDefaultImage = true;
+ }
+ picString = "<img src=\"defaultIcon\" width=\"64\" height=\"64\">";
+ }
}
- picString = "<img src=\"defaultPenguin\" width=\"64\" height=\"64\">";
}
}
mText = QString::fromLatin1(
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index e1a490d..3650b20 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -313,7 +313,7 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
SLOT( addressBookChanged() ) );
#if 0
- // LP moved to addressbook init method
+ // LR moved to addressbook init method
mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
"X-Department", "KADDRESSBOOK" );
mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,