summaryrefslogtreecommitdiffabout
path: root/kabc/stdaddressbook.cpp
Side-by-side diff
Diffstat (limited to 'kabc/stdaddressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/stdaddressbook.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp
index ec47a4e..181a09e 100644
--- a/kabc/stdaddressbook.cpp
+++ b/kabc/stdaddressbook.cpp
@@ -156,25 +156,30 @@ void StdAddressBook::init( bool )
load();
}
bool StdAddressBook::save()
{
kdDebug(5700) << "StdAddressBook::save()" << endl;
bool ok = true;
AddressBook *ab = self();
ab->deleteRemovedAddressees();
-
+ Iterator ait;
+ for ( ait = ab->begin(); ait != ab->end(); ++ait ) {
+ if ( !(*ait).IDStr().isEmpty() ) {
+ (*ait).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*ait).IDStr() );
+ }
+ }
KRES::Manager<Resource>::ActiveIterator it;
KRES::Manager<Resource> *manager = ab->resourceManager();
for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) {
if ( !(*it)->readOnly() && (*it)->isOpen() ) {
Ticket *ticket = ab->requestSaveTicket( *it );
// qDebug("StdAddressBook::save '%s'", (*it)->resourceName().latin1() );
if ( !ticket ) {
ab->error( i18n( "Unable to save to resource '%1'. It is locked." )
.arg( (*it)->resourceName() ) );
return false;
}