summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp6
-rw-r--r--kabc/addressee.h6
-rw-r--r--kabc/field.cpp24
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
@@ -1508,4 +1508,10 @@ 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
@@ -793,4 +793,10 @@ 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
@@ -33,4 +33,5 @@ $Id$
#include "field.h"
+#include "resource.h"
using namespace KABC;
@@ -83,5 +84,6 @@ class Field::FieldImpl
Organization,
Note,
- Url
+ Url,
+ Resource
};
@@ -191,4 +193,6 @@ QString Field::label()
case FieldImpl::Url:
return Addressee::urlLabel();
+ case FieldImpl::Resource:
+ return Addressee::resourceLabel();
case FieldImpl::CustomField:
return mImpl->label();
@@ -268,4 +272,7 @@ QString Field::value( const KABC::Addressee &a )
case FieldImpl::Url:
return a.url().prettyURL();
+//US
+ case FieldImpl::Resource:
+ return a.resource()->resourceName();
case FieldImpl::HomePhone:
return a.phoneNumber( PhoneNumber::Home ).number();
@@ -361,4 +368,6 @@ bool Field::setValue( KABC::Addressee &a, const QString &value )
case FieldImpl::CustomField:
a.insertCustom( mImpl->app(), mImpl->key(), value );
+//US never copy the resourcename back to the adressee.
+ case FieldImpl::Resource:
default:
return false;
@@ -409,4 +418,5 @@ Field::List Field::allFields()
createField( FieldImpl::Note );
createField( FieldImpl::Url );
+ createField( FieldImpl::Resource );
}
@@ -469,5 +479,5 @@ 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());
int custom = 0;
@@ -475,5 +485,5 @@ void Field::saveFields( KConfig *cfg, const QString &identifier,
for( it = fields.begin(); it != fields.end(); ++it ) {
//US
-//US qDebug("Field::saveFields field:%i", (*it)->mImpl->fieldId());
+// qDebug("Field::saveFields field:%i", (*it)->mImpl->fieldId());
fieldIds.append( (*it)->mImpl->fieldId() );
@@ -492,4 +502,7 @@ void Field::saveFields( KConfig *cfg, const QString &identifier,
Field::List Field::restoreFields( const QString &identifier )
{
+//US
+// qDebug("Field::restoreFields, identifier: %s", identifier.latin1());
+
KConfig *cfg = KGlobal::config();
KConfigGroupSaver( cfg, "KABCFields" );
@@ -505,5 +518,5 @@ Field::List Field::restoreFields( KConfig *cfg, const QString &identifier )
QValueList<int> fieldIds = cfg->readIntListEntry( identifier);
//US
- qDebug("Field::restoreFields from %s", cfg->getFileName().latin1());
+// qDebug("Field::restoreFields from %s, identifier: %s", cfg->getFileName().latin1(), identifier.latin1());
Field::List fields;
@@ -545,4 +558,7 @@ Field *Field::createCustomField( const QString &label, int category,
category | CustomCategory,
label, key, app ) );
+//US
+// qDebug("Field::createCustomField label %s", label.latin1() );
+
mCustomFields.append( field );