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) (side-by-side diff)
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";
}
-QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool preferred )
+QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones_unsorted ,bool preferred )
{
ExternalAppHandler* eah = ExternalAppHandler::instance();
bool kphoneAvail = eah->isPhoneAppAvailable();
@@ -561,10 +561,35 @@ QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool pr
QString extension;
int phonetype;
QString sms;
+
+ KABC::PhoneNumber::List::Iterator it;
+ KABC::PhoneNumber::List phones ;
+
+ PhoneNumber::TypeList tList = PhoneNumber::supportedTypeList();
+ int i = 0;
+ int max = tList.count();
+ while ( i < max-1 ) {
+ for ( it = phones_unsorted.begin(); it != phones_unsorted.end(); ++it ) {
+ if ( (*it).type() == tList[i] ) {
+ phones.append( (*it ) );
+ break;
+ }
+ }
+ ++i;
+ }
+ for ( it = phones_unsorted.begin(); it != phones_unsorted.end(); ++it ) {
+ if ( (*it).type() == tList[ max-1 ] )
+ phones.append( (*it ) );
+ }
+
for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) {
phonetype = (*phoneIt).type();
- if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred )
+ bool con = false;
+ if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred ) con = true;
+ if ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell ) con = !preferred;;
+ if ( con )
continue;
+
if (ksmsAvail &&
(
((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) ||