-rw-r--r-- | kabc/addressee.cpp | 2 | ||||
-rw-r--r-- | kabc/addresseeview.cpp | 29 | ||||
-rw-r--r-- | kabc/phonenumber.cpp | 15 |
3 files changed, 38 insertions, 8 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 2f4a9af..6cfac80 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -1093,5 +1093,5 @@ QString Addressee::otherPhoneLabel() QString Addressee::sipLabel() { - return i18n("SIP"); + return i18n("SiP"); } diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp index 5c24acf..cde19a1 100644 --- a/kabc/addresseeview.cpp +++ b/kabc/addresseeview.cpp @@ -549,5 +549,5 @@ 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(); @@ -562,8 +562,33 @@ QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool pr 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 && ( diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 6db1bcf..897c56d 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp @@ -100,4 +100,6 @@ int PhoneNumber::getCompatType( int type ) if ((type & Pref) == Pref) return Pcs | Pref; + if ((type & Voice) == Voice) + return Pcs | Voice; return Pcs; } @@ -108,7 +110,8 @@ int PhoneNumber::getCompatType( int type ) if ((type & Isdn) == Isdn) return Isdn; +#if 0 if ((type & Video) == Video) return Video; - +#endif if ((type & Msg) == Msg) return Msg; @@ -227,5 +230,5 @@ PhoneNumber::TypeList PhoneNumber::supportedTypeList() static TypeList list; if ( list.count() == 0 ) - list << (Home| Pref) << (Work| Pref) << Cell <<(Pcs|Pref)<< Pcs<< Home << Work << Car << (Work| Msg | Voice) << (Work| Msg) << (Home | Fax) << (Work| Fax) << Fax<< Pager << Isdn << Video << Msg << Pref << Voice; + list << (Home| Pref) << (Work| Pref) << Cell <<(Pcs|Pref)<< (Pcs|Voice)<< Home << Work << Car << Pcs <<(Work| Msg | Voice) << (Work| Msg) << (Home | Fax) << (Work| Fax) << Fax<< Pager << Isdn << Msg << Pref << Voice; return list; } @@ -234,5 +237,5 @@ QStringList PhoneNumber::supportedTypeListNames() static QStringList list; if ( list.count() == 0 ) - list << i18n("Home") << i18n("Work") << i18n("Mobile") << i18n("SIP") << i18n("VoIP") <<i18n("Home2")<< i18n("Work2") << i18n("Mobile2") << i18n("Assistent") << i18n("Company") << i18n("Fax (Home)") << i18n("Fax (Work)") << i18n("Fax (Other)") << i18n("Pager") << i18n("ISDN") << i18n("Video") << i18n("Callback") << i18n("Primary")<< i18n("Other"); + list << i18n("Home") << i18n("Work") << i18n("Mobile") << i18n("SIP") << i18n("VoIP") <<i18n("Home2")<< i18n("Work2") << i18n("Mobile2") << i18n("SIP2") << i18n("Assistent") << i18n("Company") << i18n("Fax (Home)") << i18n("Fax (Work)") << i18n("Fax (Other)") << i18n("Pager") << i18n("ISDN") << i18n("Callback") << i18n("Primary")<< i18n("Other"); return list; } @@ -281,6 +284,8 @@ QString PhoneNumber::typeLabel( int type ) if ((type & Pcs) == Pcs) { if ((type & Pref) == Pref) - return i18n("SIP"); - return i18n("VoIP"); + return i18n("SiP"); + if ((type & Voice) == Voice) + return i18n("VoIP"); + return i18n("SiP2"); } if ((type & Car) == Car) |