author | zautrix <zautrix> | 2005-03-29 19:00:52 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-29 19:00:52 (UTC) |
commit | d6e5d0b71d6a6727fbfef895a814e046a2a99aae (patch) (unidiff) | |
tree | 2bc757ab32fda4a2c1b4ad78cc99621ef3466415 | |
parent | b70d9695bb6a2d567b75965c0530792ad90c84a3 (diff) | |
download | kdepimpi-d6e5d0b71d6a6727fbfef895a814e046a2a99aae.zip kdepimpi-d6e5d0b71d6a6727fbfef895a814e046a2a99aae.tar.gz kdepimpi-d6e5d0b71d6a6727fbfef895a814e046a2a99aae.tar.bz2 |
fixes
-rw-r--r-- | kabc/addresseeview.cpp | 48 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 |
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 | |||
@@ -254,23 +254,59 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) | |||
254 | if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) { | 254 | if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) { |
255 | picString = "<img src=\"myimage\" width=\"50\" height=\"70\">"; | 255 | picString = "<img src=\"myimage\" width=\"50\" height=\"70\">"; |
256 | if ( picAvailintern ) { | 256 | if ( picAvailintern ) { |
257 | QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() ); | 257 | QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() ); |
258 | } else { | 258 | } else { |
259 | if ( picAvailUrl ) { | 259 | if ( picAvailUrl ) { |
260 | QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", QPixmap( picture.url() )); | 260 | QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", QPixmap( picture.url() )); |
261 | } else { | 261 | } else { |
262 | static bool setDefaultImage = false; | 262 | if ( !mAddressee.custom( "KADDRESSBOOK", "X-Children" ).isEmpty() ) { |
263 | if ( !setDefaultImage ) { | 263 | static bool setDefaultImageChildren = false; |
264 | qDebug("Setting default pixmap "); | 264 | if ( !setDefaultImageChildren ) { |
265 | QMimeSourceFactory::defaultFactory()->setPixmap( "defaultPenguin", KGlobal::iconLoader()->loadIcon( "package_toys", KIcon::Desktop, 128 ) ); | 265 | QMimeSourceFactory::defaultFactory()->setPixmap( "familyIcon", KGlobal::iconLoader()->loadIcon( "ic_kids", KIcon::Desktop, 128 ) ); |
266 | setDefaultImage = true; | 266 | setDefaultImageChildren = true; |
267 | } | ||
268 | picString = "<img src=\"familyIcon\" width=\"64\" height=\"64\">"; | ||
269 | |||
270 | } else if ( !mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ).isEmpty() ) { | ||
271 | static bool setDefaultImagepouses = false; | ||
272 | if ( !setDefaultImagepouses ) { | ||
273 | QMimeSourceFactory::defaultFactory()->setPixmap( "SpousesIcon", KGlobal::iconLoader()->loadIcon( "ic_family", KIcon::Desktop, 128 ) ); | ||
274 | setDefaultImagepouses = true; | ||
275 | } | ||
276 | picString = "<img src=\"SpousesIcon\" width=\"64\" height=\"64\">"; | ||
277 | } else { | ||
278 | QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" ); | ||
279 | if ( gen == "male" ) { | ||
280 | static bool setDefaultImageMale = false; | ||
281 | if ( !setDefaultImageMale ) { | ||
282 | QMimeSourceFactory::defaultFactory()->setPixmap( "MaleIcon", KGlobal::iconLoader()->loadIcon( "ic_male", KIcon::Desktop, 128 ) ); | ||
283 | setDefaultImageMale = true; | ||
284 | } | ||
285 | picString = "<img src=\"MaleIcon\" width=\"64\" height=\"64\">"; | ||
286 | |||
287 | } else if ( gen == "female" ) { | ||
288 | static bool setDefaultImageFemale = false; | ||
289 | if ( !setDefaultImageFemale ) { | ||
290 | QMimeSourceFactory::defaultFactory()->setPixmap( "FemaleIcon", KGlobal::iconLoader()->loadIcon( "ic_female", KIcon::Desktop, 128 ) ); | ||
291 | setDefaultImageFemale = true; | ||
292 | } | ||
293 | picString = "<img src=\"FemaleIcon\" width=\"64\" height=\"64\">"; | ||
294 | |||
295 | } else { | ||
296 | static bool setDefaultImage = false; | ||
297 | if ( !setDefaultImage ) { | ||
298 | qDebug("Setting default pixmap "); | ||
299 | QMimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) ); | ||
300 | setDefaultImage = true; | ||
301 | } | ||
302 | picString = "<img src=\"defaultIcon\" width=\"64\" height=\"64\">"; | ||
303 | } | ||
267 | } | 304 | } |
268 | picString = "<img src=\"defaultPenguin\" width=\"64\" height=\"64\">"; | ||
269 | } | 305 | } |
270 | } | 306 | } |
271 | mText = QString::fromLatin1( | 307 | mText = QString::fromLatin1( |
272 | "<html>" | 308 | "<html>" |
273 | "<body text=\"%1\" bgcolor=\"%2\">" // text and background color | 309 | "<body text=\"%1\" bgcolor=\"%2\">" // text and background color |
274 | "<table>" | 310 | "<table>" |
275 | "<tr>" | 311 | "<tr>" |
276 | "<td rowspan=\"3\" align=\"right\" valign=\"top\">" | 312 | "<td rowspan=\"3\" align=\"right\" valign=\"top\">" |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index e1a490d..3650b20 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -308,17 +308,17 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
308 | #ifndef KAB_EMBEDDED | 308 | #ifndef KAB_EMBEDDED |
309 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); | 309 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); |
310 | #endif //KAB_EMBEDDED | 310 | #endif //KAB_EMBEDDED |
311 | 311 | ||
312 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), | 312 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), |
313 | SLOT( addressBookChanged() ) ); | 313 | SLOT( addressBookChanged() ) ); |
314 | 314 | ||
315 | #if 0 | 315 | #if 0 |
316 | // LP moved to addressbook init method | 316 | // LR moved to addressbook init method |
317 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, | 317 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, |
318 | "X-Department", "KADDRESSBOOK" ); | 318 | "X-Department", "KADDRESSBOOK" ); |
319 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, | 319 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, |
320 | "X-Profession", "KADDRESSBOOK" ); | 320 | "X-Profession", "KADDRESSBOOK" ); |
321 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, | 321 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, |
322 | "X-AssistantsName", "KADDRESSBOOK" ); | 322 | "X-AssistantsName", "KADDRESSBOOK" ); |
323 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, | 323 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, |
324 | "X-ManagersName", "KADDRESSBOOK" ); | 324 | "X-ManagersName", "KADDRESSBOOK" ); |