-rw-r--r-- | kaddressbook/kabcore.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 47ed858..dae9cd2 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -792,67 +792,69 @@ void KABCore::beamVCard(const QStringList& uids) | |||
792 | 792 | ||
793 | QString vcard; | 793 | QString vcard; |
794 | converter.addresseeToVCard( a, vcard ); | 794 | converter.addresseeToVCard( a, vcard ); |
795 | int start = 0; | 795 | int start = 0; |
796 | int next; | 796 | int next; |
797 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { | 797 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { |
798 | int semi = vcard.find(";", next); | 798 | int semi = vcard.find(";", next); |
799 | int dopp = vcard.find(":", next); | 799 | int dopp = vcard.find(":", next); |
800 | int sep; | 800 | int sep; |
801 | if ( semi < dopp && semi >= 0 ) | 801 | if ( semi < dopp && semi >= 0 ) |
802 | sep = semi ; | 802 | sep = semi ; |
803 | else | 803 | else |
804 | sep = dopp; | 804 | sep = dopp; |
805 | datastream +=vcard.mid( start, next - start); | 805 | datastream +=vcard.mid( start, next - start); |
806 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); | 806 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); |
807 | start = sep; | 807 | start = sep; |
808 | } | 808 | } |
809 | datastream += vcard.mid( start,vcard.length() ); | 809 | datastream += vcard.mid( start,vcard.length() ); |
810 | } | 810 | } |
811 | #ifndef DESKTOP_VERSION | 811 | #ifndef DESKTOP_VERSION |
812 | QFile outFile(fileName); | 812 | QFile outFile(fileName); |
813 | if ( outFile.open(IO_WriteOnly) ) { | 813 | if ( outFile.open(IO_WriteOnly) ) { |
814 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); | 814 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); |
815 | QTextStream t( &outFile ); // use a text stream | 815 | QTextStream t( &outFile ); // use a text stream |
816 | t.setEncoding( QTextStream::UnicodeUTF8 ); | 816 | //t.setEncoding( QTextStream::UnicodeUTF8 ); |
817 | t <<datastream; | 817 | t.setEncoding( QTextStream::Latin1 ); |
818 | t <<datastream.latin1(); | ||
818 | outFile.close(); | 819 | outFile.close(); |
819 | Ir *ir = new Ir( this ); | 820 | Ir *ir = new Ir( this ); |
820 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); | 821 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); |
821 | ir->send( fileName, description, "text/x-vCard" ); | 822 | ir->send( fileName, description, "text/x-vCard" ); |
822 | } else { | 823 | } else { |
823 | qDebug("Error open temp beam file "); | 824 | qDebug("Error open temp beam file "); |
824 | return; | 825 | return; |
825 | } | 826 | } |
826 | #endif | 827 | #endif |
827 | 828 | ||
828 | } | 829 | } |
829 | 830 | ||
830 | void KABCore::beamDone( Ir *ir ) | 831 | void KABCore::beamDone( Ir *ir ) |
831 | { | 832 | { |
832 | #ifndef DESKTOP_VERSION | 833 | #ifndef DESKTOP_VERSION |
833 | delete ir; | 834 | delete ir; |
834 | #endif | 835 | #endif |
836 | topLevelWidget()->raise(); | ||
835 | } | 837 | } |
836 | 838 | ||
837 | 839 | ||
838 | void KABCore::browse( const QString& url ) | 840 | void KABCore::browse( const QString& url ) |
839 | { | 841 | { |
840 | #ifndef KAB_EMBEDDED | 842 | #ifndef KAB_EMBEDDED |
841 | kapp->invokeBrowser( url ); | 843 | kapp->invokeBrowser( url ); |
842 | #else //KAB_EMBEDDED | 844 | #else //KAB_EMBEDDED |
843 | qDebug("KABCore::browse must be fixed"); | 845 | qDebug("KABCore::browse must be fixed"); |
844 | #endif //KAB_EMBEDDED | 846 | #endif //KAB_EMBEDDED |
845 | } | 847 | } |
846 | 848 | ||
847 | void KABCore::selectAllContacts() | 849 | void KABCore::selectAllContacts() |
848 | { | 850 | { |
849 | mViewManager->setSelected( QString::null, true ); | 851 | mViewManager->setSelected( QString::null, true ); |
850 | } | 852 | } |
851 | 853 | ||
852 | void KABCore::deleteContacts() | 854 | void KABCore::deleteContacts() |
853 | { | 855 | { |
854 | QStringList uidList = mViewManager->selectedUids(); | 856 | QStringList uidList = mViewManager->selectedUids(); |
855 | deleteContacts( uidList ); | 857 | deleteContacts( uidList ); |
856 | } | 858 | } |
857 | 859 | ||
858 | void KABCore::deleteContacts( const QStringList &uids ) | 860 | void KABCore::deleteContacts( const QStringList &uids ) |