-rw-r--r-- | kabc/addressee.cpp | 6 | ||||
-rw-r--r-- | kabc/addressee.h | 6 | ||||
-rw-r--r-- | kabc/field.cpp | 24 |
3 files changed, 32 insertions, 4 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 5cb194a..d484073 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -1509,2 +1509,8 @@ Resource *Addressee::resource() const +//US +QString Addressee::resourceLabel() +{ + return i18n("Resource"); +} + void Addressee::setChanged( bool value ) diff --git a/kabc/addressee.h b/kabc/addressee.h index ee98e03..393d1cc 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h @@ -794,2 +794,8 @@ class Addressee /** + Return resourcelabel. + */ + //US + static QString resourceLabel(); + + /** Mark addressee as changed. diff --git a/kabc/field.cpp b/kabc/field.cpp index 41bbfde..bc2e176 100644 --- a/kabc/field.cpp +++ b/kabc/field.cpp @@ -34,2 +34,3 @@ $Id$ #include "field.h" +#include "resource.h" @@ -84,3 +85,4 @@ class Field::FieldImpl Note, - Url + Url, + Resource }; @@ -192,2 +194,4 @@ QString Field::label() return Addressee::urlLabel(); + case FieldImpl::Resource: + return Addressee::resourceLabel(); case FieldImpl::CustomField: @@ -269,2 +273,5 @@ QString Field::value( const KABC::Addressee &a ) return a.url().prettyURL(); +//US + case FieldImpl::Resource: + return a.resource()->resourceName(); case FieldImpl::HomePhone: @@ -362,2 +369,4 @@ bool Field::setValue( KABC::Addressee &a, const QString &value ) a.insertCustom( mImpl->app(), mImpl->key(), value ); +//US never copy the resourcename back to the adressee. + case FieldImpl::Resource: default: @@ -410,2 +419,3 @@ Field::List Field::allFields() createField( FieldImpl::Url ); + createField( FieldImpl::Resource ); } @@ -470,3 +480,3 @@ void Field::saveFields( KConfig *cfg, const QString &identifier, //US -//US qDebug("Field::saveFields to %s %s", cfg->getFileName().latin1(), identifier.latin1()); +// qDebug("Field::saveFields to %s %s", cfg->getFileName().latin1(), identifier.latin1()); @@ -476,3 +486,3 @@ void Field::saveFields( KConfig *cfg, const QString &identifier, //US -//US qDebug("Field::saveFields field:%i", (*it)->mImpl->fieldId()); +// qDebug("Field::saveFields field:%i", (*it)->mImpl->fieldId()); @@ -493,2 +503,5 @@ Field::List Field::restoreFields( const QString &identifier ) { +//US +// qDebug("Field::restoreFields, identifier: %s", identifier.latin1()); + KConfig *cfg = KGlobal::config(); @@ -506,3 +519,3 @@ Field::List Field::restoreFields( KConfig *cfg, const QString &identifier ) //US - qDebug("Field::restoreFields from %s", cfg->getFileName().latin1()); +// qDebug("Field::restoreFields from %s, identifier: %s", cfg->getFileName().latin1(), identifier.latin1()); @@ -546,2 +559,5 @@ Field *Field::createCustomField( const QString &label, int category, label, key, app ) ); +//US +// qDebug("Field::createCustomField label %s", label.latin1() ); + mCustomFields.append( field ); |