From ab099bc1be027fe01dc252a9d7a0f8821e782d65 Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 28 Oct 2005 14:43:31 +0000 Subject: fixxxx --- diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index f12f880..06f25e9 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt @@ -400,7 +400,7 @@ { "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, { "Types","Typen" }, { "Messenger","Messenger" }, -{ "Other","Anderes" }, +{ "Other","Sonstiges" }, { "Video","Video" }, { "Mailbox","Mailbox" }, { "Modem","Modem" }, @@ -824,12 +824,12 @@ { "Mobile2 (Work)","Handy2 (Arbeit)" }, { "Mobile2 (Car)","Handy2 (Auto)" }, { "Callback","Rückruf" }, -{ "Fax (Other)","Fax (Anderes)" }, +{ "Fax (Other)","Fax (Sonst.)" }, { "Primary","Bevorzugt" }, { "Mobile (Home)","Handy (Privat)" }, { "Unfiled","Nicht zugeordnet" }, { "Format.n.:","Format.N.:" }, -{ "","" }, +{ "Other Phone","Sonst. Telefon" }, { "","" }, { "","" }, { "","" }, diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 789a694..0d8e8e8 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -1095,6 +1095,10 @@ QString Addressee::pagerLabel() { return i18n("Pager"); } +QString Addressee::otherPhoneLabel() +{ + return i18n("Other Phone"); +} QString Addressee::sipLabel() { diff --git a/kabc/addressee.h b/kabc/addressee.h index 0c488eb..fcadda6 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h @@ -358,7 +358,7 @@ class Addressee Return translated label for pager field. */ static QString pagerLabel(); - + static QString otherPhoneLabel(); /** Return translated label for sip field. */ diff --git a/kabc/field.cpp b/kabc/field.cpp index 20885de..6f2b307 100644 --- a/kabc/field.cpp +++ b/kabc/field.cpp @@ -88,7 +88,8 @@ class Field::FieldImpl Resource, Sip, MobileWorkPhone, - MobileHomePhone + MobileHomePhone, + OtherPhone }; int fieldId() { return mFieldId; } @@ -206,6 +207,8 @@ QString Field::label() return Addressee::categoryLabel(); case FieldImpl::Sip: return Addressee::sipLabel(); + case FieldImpl::OtherPhone: + return Addressee::otherPhoneLabel(); case FieldImpl::CustomField: return mImpl->label(); default: @@ -310,6 +313,8 @@ QString Field::value( const KABC::Addressee &a ) return a.phoneNumber( PhoneNumber::Pager ).number(); case FieldImpl::Sip: return a.phoneNumber( PhoneNumber::Pcs | PhoneNumber::Pref ).number(); + case FieldImpl::OtherPhone: + return a.phoneNumber( PhoneNumber::Voice ).number(); case FieldImpl::HomeAddressStreet: return a.address( Address::Home ).street(); case FieldImpl::HomeAddressLocality: @@ -442,6 +447,7 @@ Field::List Field::allFields() createField( FieldImpl::Url ); createField( FieldImpl::Resource ); createField( FieldImpl::Sip ); + createField( FieldImpl::OtherPhone ); } return mAllFields; diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp index 9e7e221..66f0a5e 100644 --- a/kaddressbook/phoneeditwidget.cpp +++ b/kaddressbook/phoneeditwidget.cpp @@ -168,22 +168,31 @@ void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &li ) return; } mTypeNumberEditList.clear(); - KABC::PhoneNumber::List::Iterator it; - KABC::PhoneNumber::List list = li; - PhoneTypeNumberEdit* edit = 0;//mTypeNumberEditList.first(); + KABC::PhoneNumber::List::Iterator it; + KABC::PhoneNumber::List list2 = li; + KABC::PhoneNumber::List list ; + + PhoneNumber::TypeList tList = PhoneNumber::supportedTypeList(); + int i = 0; + int max = tList.count(); + while ( i < max-1 ) { + for ( it = list2.begin(); it != list2.end(); ++it ) { + if ( (*it).type() == tList[i] ) { + list.append( (*it ) ); + break; + } + } + ++i; + } + for ( it = list2.begin(); it != list2.end(); ++it ) { + if ( (*it).type() == tList[ max-1 ] ) + list.append( (*it ) ); + } for ( it = list.begin(); it != list.end(); ++it ) { - if ( edit ) { - edit->setPhoneNumber( (*it ) ); - edit = mTypeNumberEditList.next(); - } else { PhoneTypeNumberEdit* editNew = appendEditCombo(); editNew->setPhoneNumber( (*it ) ); - } - } - while ( edit ) { - edit->hide(); - edit = mTypeNumberEditList.next(); } + } KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers() { -- cgit v0.9.0.2