summaryrefslogtreecommitdiff
authoralwin <alwin>2003-12-25 02:21:47 (UTC)
committer alwin <alwin>2003-12-25 02:21:47 (UTC)
commite0b1bc403c2792dff3aa04a00eaf58b9defc6dac (patch) (unidiff)
treebb76837783433a91f49c555b80e1d87e3dee720a
parentdd78bcd2bf8dd6432b54af61e17a75dcc05c2406 (diff)
downloadopie-e0b1bc403c2792dff3aa04a00eaf58b9defc6dac.zip
opie-e0b1bc403c2792dff3aa04a00eaf58b9defc6dac.tar.gz
opie-e0b1bc403c2792dff3aa04a00eaf58b9defc6dac.tar.bz2
called binary when sending email to a contact is "opiemail" instead
of "mail" when using opiemal as standard mailer.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 9f668f4..00cd2a6 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -520,100 +520,100 @@ void AddressbookWindow::slotFind()
520} 520}
521 521
522void AddressbookWindow::slotViewBack() 522void AddressbookWindow::slotViewBack()
523{ 523{
524 // :SX showList(); 524 // :SX showList();
525} 525}
526 526
527void AddressbookWindow::slotViewEdit() 527void AddressbookWindow::slotViewEdit()
528{ 528{
529 if(!syncing) { 529 if(!syncing) {
530 if (actionPersonal->isOn()) { 530 if (actionPersonal->isOn()) {
531 editPersonal(); 531 editPersonal();
532 } else { 532 } else {
533 editEntry( EditEntry ); 533 editEntry( EditEntry );
534 } 534 }
535 } else { 535 } else {
536 QMessageBox::warning( this, tr("Contacts"), 536 QMessageBox::warning( this, tr("Contacts"),
537 tr("Can not edit data, currently syncing") ); 537 tr("Can not edit data, currently syncing") );
538 } 538 }
539} 539}
540 540
541 541
542 542
543void AddressbookWindow::writeMail() 543void AddressbookWindow::writeMail()
544{ 544{
545 OContact c = m_abView -> currentEntry(); 545 OContact c = m_abView -> currentEntry();
546 QString name = c.fileAs(); 546 QString name = c.fileAs();
547 QString email = c.defaultEmail(); 547 QString email = c.defaultEmail();
548 548
549 // I prefer the OPIE-Environment variable before the 549 // I prefer the OPIE-Environment variable before the
550 // QPE-one.. 550 // QPE-one..
551 QString basepath = QString::fromLatin1( getenv("OPIEDIR") ); 551 QString basepath = QString::fromLatin1( getenv("OPIEDIR") );
552 if ( basepath.isEmpty() ) 552 if ( basepath.isEmpty() )
553 basepath = QString::fromLatin1( getenv("QPEDIR") ); 553 basepath = QString::fromLatin1( getenv("QPEDIR") );
554 554
555 // Try to access the preferred. If not possible, try to 555 // Try to access the preferred. If not possible, try to
556 // switch to the other one.. 556 // switch to the other one..
557 if ( m_config.useQtMail() ){ 557 if ( m_config.useQtMail() ){
558 qWarning ("Accessing: %s", (basepath + "/bin/qtmail").latin1()); 558 qWarning ("Accessing: %s", (basepath + "/bin/qtmail").latin1());
559 if ( QFile::exists( basepath + "/bin/qtmail" ) ){ 559 if ( QFile::exists( basepath + "/bin/qtmail" ) ){
560 qWarning ("QCop"); 560 qWarning ("QCop");
561 QCopEnvelope e("QPE/Application/qtmail", "writeMail(QString,QString)"); 561 QCopEnvelope e("QPE/Application/qtmail", "writeMail(QString,QString)");
562 e << name << email; 562 e << name << email;
563 return; 563 return;
564 } else 564 } else
565 m_config.setUseOpieMail( true ); 565 m_config.setUseOpieMail( true );
566 } 566 }
567 if ( m_config.useOpieMail() ){ 567 if ( m_config.useOpieMail() ){
568 qWarning ("Accessing: %s", (basepath + "/bin/mail").latin1()); 568 qWarning ("Accessing: %s", (basepath + "/bin/opiemail").latin1());
569 if ( QFile::exists( basepath + "/bin/mail" ) ){ 569 if ( QFile::exists( basepath + "/bin/opiemail" ) ){
570 qWarning ("QCop"); 570 qWarning ("QCop");
571 QCopEnvelope e("QPE/Application/mail", "writeMail(QString,QString)"); 571 QCopEnvelope e("QPE/Application/opiemail", "writeMail(QString,QString)");
572 e << name << email; 572 e << name << email;
573 return; 573 return;
574 } else 574 } else
575 m_config.setUseQtMail( true ); 575 m_config.setUseQtMail( true );
576 } 576 }
577 577
578} 578}
579 579
580static const char * beamfile = "/tmp/obex/contact.vcf"; 580static const char * beamfile = "/tmp/obex/contact.vcf";
581 581
582void AddressbookWindow::slotBeam() 582void AddressbookWindow::slotBeam()
583{ 583{
584 QString beamFilename; 584 QString beamFilename;
585 OContact c; 585 OContact c;
586 if ( actionPersonal->isOn() ) { 586 if ( actionPersonal->isOn() ) {
587 beamFilename = addressbookPersonalVCardName(); 587 beamFilename = addressbookPersonalVCardName();
588 if ( !QFile::exists( beamFilename ) ) 588 if ( !QFile::exists( beamFilename ) )
589 return; // can't beam a non-existent file 589 return; // can't beam a non-existent file
590 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, 590 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
591 beamFilename ); 591 beamFilename );
592 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); 592 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true );
593 OContactAccess::List allList = access->allRecords(); 593 OContactAccess::List allList = access->allRecords();
594 OContactAccess::List::Iterator it = allList.begin(); // Just take first 594 OContactAccess::List::Iterator it = allList.begin(); // Just take first
595 c = *it; 595 c = *it;
596 596
597 delete access; 597 delete access;
598 } else { 598 } else {
599 unlink( beamfile ); // delete if exists 599 unlink( beamfile ); // delete if exists
600 mkdir("/tmp/obex/", 0755); 600 mkdir("/tmp/obex/", 0755);
601 c = m_abView -> currentEntry(); 601 c = m_abView -> currentEntry();
602 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, 602 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
603 beamfile ); 603 beamfile );
604 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); 604 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true );
605 access->add( c ); 605 access->add( c );
606 access->save(); 606 access->save();
607 delete access; 607 delete access;
608 608
609 beamFilename = beamfile; 609 beamFilename = beamfile;
610 } 610 }
611 611
612 qWarning("Beaming: %s", beamFilename.latin1() ); 612 qWarning("Beaming: %s", beamFilename.latin1() );
613 613
614 Ir *ir = new Ir( this ); 614 Ir *ir = new Ir( this );
615 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 615 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
616 QString description = c.fullName(); 616 QString description = c.fullName();
617 ir->send( beamFilename, description, "text/x-vCard" ); 617 ir->send( beamFilename, description, "text/x-vCard" );
618} 618}
619 619