-rw-r--r-- | kabc/addresseeview.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp index 90be928..7a4336b 100644 --- a/kabc/addresseeview.cpp +++ b/kabc/addresseeview.cpp @@ -86,26 +86,23 @@ void AddresseeView::setSource(const QString& n) ExternalAppHandler::instance()->callBySIP( n.mid(6) ); } -void AddresseeView::setAddressee( const KABC::Addressee& addr ) +void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) { - ExternalAppHandler* eah = ExternalAppHandler::instance(); - bool kemailAvail = eah->isEmailAppAvailable(); - - - - mAddressee = addr; + bool kemailAvail = ExternalAppHandler::instance()->isEmailAppAvailable(); + // mAddressee = addr; // clear view - setText( QString::null ); + //setText( QString::null ); - if ( mAddressee.isEmpty() ) + if ( mAddressee.isEmpty() ) { + setText( QString::null); return; - + } QString name = ( mAddressee.assembledName().isEmpty() ? mAddressee.formattedName() : mAddressee.assembledName() ); QString dynamicPart; - dynamicPart += getPhoneNumbers( true ); + dynamicPart += getPhoneNumbers( mAddressee.phoneNumbers(),true ); QStringList emails = mAddressee.emails(); QStringList::ConstIterator emailIt; QString type = i18n( "Email" ); @@ -136,7 +133,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) .arg( i18n ("Birthday") ) .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) ); } - dynamicPart += getPhoneNumbers( false ); + dynamicPart += getPhoneNumbers( mAddressee.phoneNumbers(), false ); for ( ; emailIt != emails.end(); ++emailIt ) { if ( kemailAvail ) { @@ -308,7 +305,7 @@ mText = "<table width=\"100%\">\n"; } -QString AddresseeView::getPhoneNumbers( bool preferred ) +QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool preferred ) { ExternalAppHandler* eah = ExternalAppHandler::instance(); bool kphoneAvail = eah->isPhoneAppAvailable(); @@ -317,7 +314,6 @@ QString AddresseeView::getPhoneNumbers( bool preferred ) bool kpagerAvail = eah->isPagerAppAvailable(); bool ksipAvail = eah->isSIPAppAvailable(); QString dynamicPart; - KABC::PhoneNumber::List phones = mAddressee.phoneNumbers(); KABC::PhoneNumber::List::ConstIterator phoneIt; QString extension; int phonetype; @@ -377,10 +373,12 @@ QString AddresseeView::getPhoneNumbers( bool preferred ) } return dynamicPart; } +/* KABC::Addressee AddresseeView::addressee() const { return mAddressee; } +*/ void AddresseeView::addTag(const QString & tag,const QString & text) { if ( text.isEmpty() ) |