-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 6 | ||||
-rw-r--r-- | kabc/addressee.cpp | 25 | ||||
-rw-r--r-- | kabc/addressee.h | 5 | ||||
-rw-r--r-- | kabc/field.cpp | 20 | ||||
-rw-r--r-- | kabc/phonenumber.cpp | 11 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 2 |
7 files changed, 60 insertions, 11 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 53eb428..bc0c62a 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -5,2 +5,4 @@ Info about the changes in new versions of KDE-Pim/Pi And again fixed some bugs. +Added two more fields to the KA/Pi view config: +A "Mobile (home)" and a "Mobile (work)" field. diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index e54e140..f67a34d 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt @@ -755,5 +755,5 @@ { "%1 contacts changed!","%1 Kontakte geändert!" },
-{ "","" },
-{ "","" },
-{ "","" },
+{ "Mobile (home)","Handy (Arbeit)" },
+{ "Mobile (work)","Handy (Privat)" },
+{ "Def.Formatted Name","Def. Format. Name" },
{ "","" },
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 39d14bb..7f592e9 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -53,2 +53,3 @@ struct Addressee::AddresseeData : public KShared QString formattedName; + QString defaultFormattedName; QString familyName; @@ -749,2 +750,9 @@ void Addressee::setFormattedName( const QString &formattedName ) } +void Addressee::setDefaultFormattedName( const QString &formattedName ) +{ + if ( formattedName == mData->defaultFormattedName ) return; + detach(); + mData->empty = false; + mData->defaultFormattedName = formattedName; +} @@ -754,2 +762,6 @@ QString Addressee::formattedName() const } +QString Addressee::defaultFormattedName() const +{ + return mData->defaultFormattedName; +} @@ -760,2 +772,7 @@ QString Addressee::formattedNameLabel() +QString Addressee::defaultFormattedNameLabel() +{ + return i18n("Def.Formatted Name"); +} + @@ -982,2 +999,10 @@ QString Addressee::mobilePhoneLabel() } +QString Addressee::mobileWorkPhoneLabel() +{ + return i18n("Mobile (work)"); +} +QString Addressee::mobileHomePhoneLabel() +{ + return i18n("Mobile (home)"); +} diff --git a/kabc/addressee.h b/kabc/addressee.h index 8051fec..0d688f8 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h @@ -156,2 +156,3 @@ class Addressee void setFormattedName( const QString &formattedName ); + void setDefaultFormattedName( const QString &formattedName ); /** @@ -160,2 +161,3 @@ class Addressee QString formattedName() const; + QString defaultFormattedName() const; /** @@ -164,2 +166,3 @@ class Addressee static QString formattedNameLabel(); + static QString defaultFormattedNameLabel(); @@ -330,2 +333,4 @@ class Addressee static QString mobilePhoneLabel(); + static QString mobileWorkPhoneLabel(); + static QString mobileHomePhoneLabel(); diff --git a/kabc/field.cpp b/kabc/field.cpp index 89d0b77..5c561c3 100644 --- a/kabc/field.cpp +++ b/kabc/field.cpp @@ -88,3 +88,6 @@ class Field::FieldImpl Resource, - Sip + Sip, + DefaultFormattedName, + MobileWorkPhone, + MobileHomePhone }; @@ -128,2 +131,4 @@ QString Field::label() return Addressee::formattedNameLabel(); + case FieldImpl::DefaultFormattedName: + return Addressee::defaultFormattedNameLabel(); case FieldImpl::FamilyName: @@ -172,2 +177,6 @@ QString Field::label() return Addressee::mobilePhoneLabel(); + case FieldImpl::MobileHomePhone: + return Addressee::mobileHomePhoneLabel(); + case FieldImpl::MobileWorkPhone: + return Addressee::mobileWorkPhoneLabel(); case FieldImpl::HomeFax: @@ -241,2 +250,4 @@ QString Field::value( const KABC::Addressee &a ) return a.formattedName(); + case FieldImpl::DefaultFormattedName: + return a.defaultFormattedName(); case FieldImpl::FamilyName: @@ -290,2 +301,6 @@ QString Field::value( const KABC::Addressee &a ) return a.phoneNumber( PhoneNumber::Cell ).number(); + case FieldImpl::MobileWorkPhone: + return a.phoneNumber( PhoneNumber::Cell | PhoneNumber::Work ).number(); + case FieldImpl::MobileHomePhone: + return a.phoneNumber( PhoneNumber::Cell | PhoneNumber::Home ).number(); case FieldImpl::HomeFax: @@ -395,2 +410,3 @@ Field::List Field::allFields() createField( FieldImpl::FormattedName, Frequent ); + createField( FieldImpl::DefaultFormattedName, Frequent ); createField( FieldImpl::FamilyName, Frequent ); @@ -418,2 +434,4 @@ Field::List Field::allFields() createField( FieldImpl::MobilePhone, Frequent ); + createField( FieldImpl::MobileHomePhone, Frequent ); + createField( FieldImpl::MobileWorkPhone, Frequent ); createField( FieldImpl::HomeFax ); diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 041effc..4c6231d 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp @@ -179,11 +179,10 @@ QString PhoneNumber::typeLabel( int type ) - if ((type & Home) == Home) - typeString += i18n("Home"); - else if ((type & Work) == Work) - typeString += i18n("Work"); - if (!typeString.isEmpty()) - typeString += " "; if ((type & Cell) == Cell) typeString += i18n("Mobile") +" "; + if ((type & Home) == Home) + typeString += i18n("Home")+" "; + else if ((type & Work) == Work) + typeString += i18n("Work")+" "; + if ((type & Sip) == Sip) diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index e322473..565cd1d 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -188,3 +188,3 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) // of items. - mListView->repaint(); + //mListView->repaint(); if ( mListView->firstChild() ) { |