-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 0276231..8937227 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -543,12 +543,12 @@ static const char * beamfile = "/tmp/obex/contact.vcf"; void AddressbookWindow::slotBeam() { - QString filename; + QString beamFilename; OContact c; if ( actionPersonal->isOn() ) { - filename = addressbookPersonalVCardName(); - if (!QFile::exists(filename)) + beamFilename = addressbookPersonalVCardName(); + if ( !QFile::exists( beamFilename ) ) return; // can't beam a non-existent file OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, - filename ); + beamFilename ); OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); OContactAccess::List allList = access->allRecords(); @@ -568,16 +568,18 @@ void AddressbookWindow::slotBeam() delete access; - filename = beamfile; + beamFilename = beamfile; } + qWarning("Beaming: %s", beamFilename.latin1() ); Ir *ir = new Ir( this ); connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); QString description = c.fullName(); - ir->send( filename, description, "text/x-vCard" ); + ir->send( beamFilename, description, "text/x-vCard" ); } void AddressbookWindow::beamDone( Ir *ir ) { + delete ir; unlink( beamfile ); @@ -640,7 +642,13 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) // :SXm_abView()->init( cnt ); editEntry( EditEntry ); - - - + } else if ( msg == "beamBusinessCard()" ) { + QString beamFilename = addressbookPersonalVCardName(); + if ( !QFile::exists( beamFilename ) ) + return; // can't beam a non-existent file + + Ir *ir = new Ir( this ); + connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); + QString description = "mycard.vcf"; + ir->send( beamFilename, description, "text/x-vCard" ); } #if 0 |