summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index e053e94..975911e 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -631,99 +631,105 @@ static void parseName( const QString& name, QString *first, QString *middle,
631 if ( comma > 0 ) { 631 if ( comma > 0 ) {
632 *last = name.left( comma ); 632 *last = name.left( comma );
633 comma++; 633 comma++;
634 while ( comma < int(name.length()) && name[comma] == ' ' ) 634 while ( comma < int(name.length()) && name[comma] == ' ' )
635 comma++; 635 comma++;
636 rest = name.mid( comma ); 636 rest = name.mid( comma );
637 } else { 637 } else {
638 int space = name.findRev( ' ' ); 638 int space = name.findRev( ' ' );
639 *last = name.mid( space+1 ); 639 *last = name.mid( space+1 );
640 rest = name.left( space ); 640 rest = name.left( space );
641 } 641 }
642 int space = rest.find( ' ' ); 642 int space = rest.find( ' ' );
643 if ( space <= 0 ) { 643 if ( space <= 0 ) {
644 *first = rest; 644 *first = rest;
645 } else { 645 } else {
646 *first = rest.left( space ); 646 *first = rest.left( space );
647 *middle = rest.mid( space+1 ); 647 *middle = rest.mid( space+1 );
648 } 648 }
649 649
650} 650}
651 651
652 652
653void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) 653void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
654{ 654{
655 qWarning("Receiving QCop-Call with message %s", QString( msg ).latin1() );
656
655 if (msg == "editPersonal()") { 657 if (msg == "editPersonal()") {
656 editPersonal(); 658 editPersonal();
657 } else if (msg == "editPersonalAndClose()") { 659 } else if (msg == "editPersonalAndClose()") {
658 editPersonal(); 660 editPersonal();
659 close(); 661 close();
660 } else if ( msg == "addContact(QString,QString)" ) { 662 } else if ( msg == "addContact(QString,QString)" ) {
661 QDataStream stream(data,IO_ReadOnly); 663 QDataStream stream(data,IO_ReadOnly);
662 QString name, email; 664 QString name, email;
663 stream >> name >> email; 665 stream >> name >> email;
664 666
665 OContact cnt; 667 OContact cnt;
666 QString fn, mn, ln; 668 QString fn, mn, ln;
667 parseName( name, &fn, &mn, &ln ); 669 parseName( name, &fn, &mn, &ln );
668 // qDebug( " %s - %s - %s", fn.latin1(), mn.latin1(), ln.latin1() ); 670 // qDebug( " %s - %s - %s", fn.latin1(), mn.latin1(), ln.latin1() );
669 cnt.setFirstName( fn ); 671 cnt.setFirstName( fn );
670 cnt.setMiddleName( mn ); 672 cnt.setMiddleName( mn );
671 cnt.setLastName( ln ); 673 cnt.setLastName( ln );
672 cnt.insertEmails( email ); 674 cnt.insertEmails( email );
673 cnt.setDefaultEmail( email ); 675 cnt.setDefaultEmail( email );
674 cnt.setFileAs(); 676 cnt.setFileAs();
675 677
676 m_abView -> addEntry( cnt ); 678 m_abView -> addEntry( cnt );
677 679
678 // :SXm_abView()->init( cnt ); 680 // :SXm_abView()->init( cnt );
679 editEntry( EditEntry ); 681 editEntry( EditEntry );
680 } else if ( msg == "beamBusinessCard()" ) { 682 } else if ( msg == "beamBusinessCard()" ) {
681 QString beamFilename = addressbookPersonalVCardName(); 683 QString beamFilename = addressbookPersonalVCardName();
682 if ( !QFile::exists( beamFilename ) ) 684 if ( !QFile::exists( beamFilename ) )
683 return; // can't beam a non-existent file 685 return; // can't beam a non-existent file
684 686
685 Ir *ir = new Ir( this ); 687 Ir *ir = new Ir( this );
686 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 688 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
687 QString description = "mycard.vcf"; 689 QString description = "mycard.vcf";
688 ir->send( beamFilename, description, "text/x-vCard" ); 690 ir->send( beamFilename, description, "text/x-vCard" );
689 } else if ( msg == "showUid(int)" ) { 691 } else if ( msg == "show(int)" ) {
690 QDataStream stream(data,IO_ReadOnly); 692 QDataStream stream(data,IO_ReadOnly);
691 int uid; 693 int uid;
692 stream >> uid; 694 stream >> uid;
693 695
696 qWarning( "Showing uid: %d" , uid );
697
694 // Deactivate Personal View.. 698 // Deactivate Personal View..
695 if ( actionPersonal->isOn() ){ 699 if ( actionPersonal->isOn() ){
696 actionPersonal->setOn( false ); 700 actionPersonal->setOn( false );
697 slotPersonalView(); 701 slotPersonalView();
698 } 702 }
699 703
700 // Reset category and show as card.. 704 // Reset category and show as card..
701 m_abView -> setShowByCategory( QString::null ); 705 m_abView -> setShowByCategory( QString::null );
702 m_abView -> setCurrentUid( uid ); 706 m_abView -> setCurrentUid( uid );
703 slotViewSwitched ( AbView::CardView ); 707 slotViewSwitched ( AbView::CardView );
708
709 qApp->exec();
704 710
705 } else if ( msg == "editUid(int)" ) { 711 } else if ( msg == "edit(int)" ) {
706 QDataStream stream(data,IO_ReadOnly); 712 QDataStream stream(data,IO_ReadOnly);
707 int uid; 713 int uid;
708 stream >> uid; 714 stream >> uid;
709 715
710 // Deactivate Personal View.. 716 // Deactivate Personal View..
711 if ( actionPersonal->isOn() ){ 717 if ( actionPersonal->isOn() ){
712 actionPersonal->setOn( false ); 718 actionPersonal->setOn( false );
713 slotPersonalView(); 719 slotPersonalView();
714 } 720 }
715 721
716 // Reset category and edit.. 722 // Reset category and edit..
717 m_abView -> setShowByCategory( QString::null ); 723 m_abView -> setShowByCategory( QString::null );
718 m_abView -> setCurrentUid( uid ); 724 m_abView -> setCurrentUid( uid );
719 slotViewEdit(); 725 slotViewEdit();
720 } 726 }
721 727
722} 728}
723 729
724void AddressbookWindow::editEntry( EntryMode entryMode ) 730void AddressbookWindow::editEntry( EntryMode entryMode )
725{ 731{
726 OContact entry; 732 OContact entry;
727 if ( !abEditor ) { 733 if ( !abEditor ) {
728 abEditor = new ContactEditor( entry, this, "editor" ); 734 abEditor = new ContactEditor( entry, this, "editor" );
729 } 735 }