summaryrefslogtreecommitdiffabout
path: root/kabc/addresseeview.cpp
authorzautrix <zautrix>2005-10-29 22:45:39 (UTC)
committer zautrix <zautrix>2005-10-29 22:45:39 (UTC)
commitb06fa1090f3fa7a71ab2710be444815df8bd6c17 (patch) (unidiff)
tree16f5aed10d0c78c255ae732959e3dd184ae5e218 /kabc/addresseeview.cpp
parenta4f17bd35c56280c45bda847b42b7d3a003b0a42 (diff)
downloadkdepimpi-b06fa1090f3fa7a71ab2710be444815df8bd6c17.zip
kdepimpi-b06fa1090f3fa7a71ab2710be444815df8bd6c17.tar.gz
kdepimpi-b06fa1090f3fa7a71ab2710be444815df8bd6c17.tar.bz2
commit
Diffstat (limited to 'kabc/addresseeview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addresseeview.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp
index 5c24acf..cde19a1 100644
--- a/kabc/addresseeview.cpp
+++ b/kabc/addresseeview.cpp
@@ -548,7 +548,7 @@ mText = "<table width=\"100%\">\n";
548 548
549} 549}
550 550
551QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool preferred ) 551QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones_unsorted ,bool preferred )
552{ 552{
553 ExternalAppHandler* eah = ExternalAppHandler::instance(); 553 ExternalAppHandler* eah = ExternalAppHandler::instance();
554 bool kphoneAvail = eah->isPhoneAppAvailable(); 554 bool kphoneAvail = eah->isPhoneAppAvailable();
@@ -561,10 +561,35 @@ QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool pr
561 QString extension; 561 QString extension;
562 int phonetype; 562 int phonetype;
563 QString sms; 563 QString sms;
564
565 KABC::PhoneNumber::List::Iterator it;
566 KABC::PhoneNumber::List phones ;
567
568 PhoneNumber::TypeList tList = PhoneNumber::supportedTypeList();
569 int i = 0;
570 int max = tList.count();
571 while ( i < max-1 ) {
572 for ( it = phones_unsorted.begin(); it != phones_unsorted.end(); ++it ) {
573 if ( (*it).type() == tList[i] ) {
574 phones.append( (*it ) );
575 break;
576 }
577 }
578 ++i;
579 }
580 for ( it = phones_unsorted.begin(); it != phones_unsorted.end(); ++it ) {
581 if ( (*it).type() == tList[ max-1 ] )
582 phones.append( (*it ) );
583 }
584
564 for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { 585 for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) {
565 phonetype = (*phoneIt).type(); 586 phonetype = (*phoneIt).type();
566 if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred ) 587 bool con = false;
588 if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred ) con = true;
589 if ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell ) con = !preferred;;
590 if ( con )
567 continue; 591 continue;
592
568 if (ksmsAvail && 593 if (ksmsAvail &&
569 ( 594 (
570 ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) || 595 ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) ||