summaryrefslogtreecommitdiff
authoreilers <eilers>2003-02-28 10:25:31 (UTC)
committer eilers <eilers>2003-02-28 10:25:31 (UTC)
commit81cbb2d97b4f0cd7eef56536d791434856d7ae8d (patch) (unidiff)
tree644f7c1dc38c07b67b9337a4138ca80741d0c9ca
parent18c19111466e43e91678c5a1fa50f2f561ca3257 (diff)
downloadopie-81cbb2d97b4f0cd7eef56536d791434856d7ae8d.zip
opie-81cbb2d97b4f0cd7eef56536d791434856d7ae8d.tar.gz
opie-81cbb2d97b4f0cd7eef56536d791434856d7ae8d.tar.bz2
Beaming personal vcard on keypress is implented now !
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp26
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
@@ -542,14 +542,14 @@ static const char * beamfile = "/tmp/obex/contact.vcf";
542 542
543void AddressbookWindow::slotBeam() 543void AddressbookWindow::slotBeam()
544{ 544{
545 QString filename; 545 QString beamFilename;
546 OContact c; 546 OContact c;
547 if ( actionPersonal->isOn() ) { 547 if ( actionPersonal->isOn() ) {
548 filename = addressbookPersonalVCardName(); 548 beamFilename = addressbookPersonalVCardName();
549 if (!QFile::exists(filename)) 549 if ( !QFile::exists( beamFilename ) )
550 return; // can't beam a non-existent file 550 return; // can't beam a non-existent file
551 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, 551 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
552 filename ); 552 beamFilename );
553 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); 553 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true );
554 OContactAccess::List allList = access->allRecords(); 554 OContactAccess::List allList = access->allRecords();
555 OContactAccess::List::Iterator it = allList.begin(); // Just take first 555 OContactAccess::List::Iterator it = allList.begin(); // Just take first
@@ -567,18 +567,20 @@ void AddressbookWindow::slotBeam()
567 access->save(); 567 access->save();
568 delete access; 568 delete access;
569 569
570 filename = beamfile; 570 beamFilename = beamfile;
571 } 571 }
572 572
573 qWarning("Beaming: %s", beamFilename.latin1() );
573 574
574 Ir *ir = new Ir( this ); 575 Ir *ir = new Ir( this );
575 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 576 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
576 QString description = c.fullName(); 577 QString description = c.fullName();
577 ir->send( filename, description, "text/x-vCard" ); 578 ir->send( beamFilename, description, "text/x-vCard" );
578} 579}
579 580
580void AddressbookWindow::beamDone( Ir *ir ) 581void AddressbookWindow::beamDone( Ir *ir )
581{ 582{
583
582 delete ir; 584 delete ir;
583 unlink( beamfile ); 585 unlink( beamfile );
584} 586}
@@ -639,9 +641,15 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
639 641
640 // :SXm_abView()->init( cnt ); 642 // :SXm_abView()->init( cnt );
641 editEntry( EditEntry ); 643 editEntry( EditEntry );
642 644 } else if ( msg == "beamBusinessCard()" ) {
643 645 QString beamFilename = addressbookPersonalVCardName();
644 646 if ( !QFile::exists( beamFilename ) )
647 return; // can't beam a non-existent file
648
649 Ir *ir = new Ir( this );
650 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
651 QString description = "mycard.vcf";
652 ir->send( beamFilename, description, "text/x-vCard" );
645 } 653 }
646#if 0 654#if 0
647 else if (msg == "pickAddresses(QCString,QCString,QStringList,...)" ) { 655 else if (msg == "pickAddresses(QCString,QCString,QStringList,...)" ) {