-rw-r--r-- | kde2file/abdump/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kde2file/abdump/main.cpp b/kde2file/abdump/main.cpp index d452ee9..1ee64f5 100644 --- a/kde2file/abdump/main.cpp +++ b/kde2file/abdump/main.cpp @@ -127,24 +127,25 @@ int main( int argc, char *argv[] ) if ( file.open( IO_ReadOnly ) ) { QTextStream t( &file ); // use a text stream t.setEncoding( QTextStream::UnicodeUTF8 ); QString data; data = t.read(); file.close(); KABC::VCardConverter converter; list = converter.parseVCards( data ); qDebug("kdeABdump::file has %d entries", list.count()); KABC::Addressee::List::Iterator it; for ( it = list.begin();it != list.end();++it) { + (*it).setChanged( true ); bool changed = ((*it).custom( "KADDRESSBOOK", "X-ExternalID" ) == "changed"); (*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" ); //qDebug("ext %s ", (*it).custom( "KADDRESSBOOK", "X-ExternalID" ).latin1()); if ( changed ) { //qDebug("changed Addressee found! "); KABC::Addressee std = standardAddressBook->findByUid( (*it).uid() ); if ( ! std.isEmpty() ) (*it).setResource(std.resource()); standardAddressBook->insertAddressee( (*it) ); ++changedC; } else { //maybe added? @@ -177,17 +178,18 @@ int main( int argc, char *argv[] ) } //standardAddressBook->saveAll(); standardAddressBook->setAutomaticSave( true ); qDebug("************************************* "); qDebug("*************kdeABdump*************** "); qDebug("************************************* "); qDebug("Addressbook entries\nchanged %d\ndeleted %d\nadded %d\nfrom file %s", changedC,deleted, added, fileName.latin1()); } else qDebug("error open file "); } - KABC::StdAddressBook::close(); - + delete standardAddressBook; + //KABC::StdAddressBook::close(); + //StdAddressBook::mSelf = 0; qDebug("ente "); return 0; } |