summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 185cf46..7bec90a 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -18,13 +18,13 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*s
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
@@ -36,12 +36,13 @@ $Id$
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qlabel.h> 37#include <qlabel.h>
38#include <qlineedit.h> 38#include <qlineedit.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qpushbutton.h> 40#include <qpushbutton.h>
41#include <qprogressbar.h> 41#include <qprogressbar.h>
42#include <libkdepim/phoneaccess.h>
42 43
43#ifndef KAB_EMBEDDED 44#ifndef KAB_EMBEDDED
44#include <qclipboard.h> 45#include <qclipboard.h>
45#include <qdir.h> 46#include <qdir.h>
46#include <qfile.h> 47#include <qfile.h>
47#include <qapplicaton.h> 48#include <qapplicaton.h>
@@ -670,27 +671,27 @@ void KABCore::export2phone()
670 return; 671 return;
671 } 672 }
672 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 673 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
673 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 674 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
674 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 675 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
675 676
676#if 0 677
677 PhoneFormat::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 678 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
678 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 679 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
679 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 680 KPimGlobalPrefs::instance()->mEx2PhoneModel );
680 681
682 QStringList uids = mViewManager->selectedUids();
683 if ( uids.isEmpty() )
684 return;
681 685
686#ifdef _WIN32_
687 QString fileName = locateLocal("tmp", "tempfile.vcf");
688#else
689 QString fileName = "/tmp/kdepimtemp.vcf";
690#endif
682 691
683
684
685 QString fileName = "/tmp/kapibeamfile.vcf";
686
687
688 //QDir().mkdir( dirName, true );
689
690
691 KABC::VCardConverter converter; 692 KABC::VCardConverter converter;
692 QString description; 693 QString description;
693 QString datastream; 694 QString datastream;
694 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 695 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
695 KABC::Addressee a = mAddressBook->findByUid( *it ); 696 KABC::Addressee a = mAddressBook->findByUid( *it );
696 697
@@ -715,31 +716,26 @@ void KABCore::export2phone()
715 datastream +=vcard.mid( start, next - start); 716 datastream +=vcard.mid( start, next - start);
716 datastream +=vcard.mid( next+5,sep -next -5 ).upper(); 717 datastream +=vcard.mid( next+5,sep -next -5 ).upper();
717 start = sep; 718 start = sep;
718 } 719 }
719 datastream += vcard.mid( start,vcard.length() ); 720 datastream += vcard.mid( start,vcard.length() );
720 } 721 }
721#ifndef DESKTOP_VERSION
722 QFile outFile(fileName); 722 QFile outFile(fileName);
723 if ( outFile.open(IO_WriteOnly) ) { 723 if ( outFile.open(IO_WriteOnly) ) {
724 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 724 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
725 QTextStream t( &outFile ); // use a text stream 725 QTextStream t( &outFile ); // use a text stream
726 t.setEncoding( QTextStream::UnicodeUTF8 ); 726 t.setEncoding( QTextStream::UnicodeUTF8 );
727 t <<datastream; 727 t <<datastream;
728 outFile.close(); 728 outFile.close();
729 Ir *ir = new Ir( this );
730 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
731 ir->send( fileName, description, "text/x-vCard" );
732 } else { 729 } else {
733 qDebug("Error open temp beam file "); 730 qDebug("Error open temp file ");
734 return; 731 return;
735 } 732 }
736#endif
737
738 733
739 734
735#if 0
740 736
741 setCaption( i18n("Writing to phone...")); 737 setCaption( i18n("Writing to phone..."));
742 if ( PhoneFormat::writeToPhone( cal ) ) 738 if ( PhoneFormat::writeToPhone( cal ) )
743 setCaption( i18n("Export to phone successful!")); 739 setCaption( i18n("Export to phone successful!"));
744 else 740 else
745 setCaption( i18n("Error exporting to phone!")); 741 setCaption( i18n("Error exporting to phone!"));