From 81cbb2d97b4f0cd7eef56536d791434856d7ae8d Mon Sep 17 00:00:00 2001 From: eilers Date: Fri, 28 Feb 2003 10:25:31 +0000 Subject: Beaming personal vcard on keypress is implented now ! --- (limited to 'core/pim/addressbook') 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 @@ -542,14 +542,14 @@ 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(); OContactAccess::List::Iterator it = allList.begin(); // Just take first @@ -567,18 +567,20 @@ void AddressbookWindow::slotBeam() access->save(); 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 ); } @@ -639,9 +641,15 @@ 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 else if (msg == "pickAddresses(QCString,QCString,QStringList,...)" ) { -- cgit v0.9.0.2