summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
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
@@ -21,7 +21,7 @@
without including the source code for Qt in the source distribution.
*/
-/*
+/*s
Enhanced Version of the file for platform independent KDE tools.
Copyright (c) 2004 Ulf Schenk
@@ -39,6 +39,7 @@ $Id$
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qprogressbar.h>
+#include <libkdepim/phoneaccess.h>
#ifndef KAB_EMBEDDED
#include <qclipboard.h>
@@ -673,21 +674,21 @@ void KABCore::export2phone()
KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
-#if 0
- PhoneFormat::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
+
+ PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
KPimGlobalPrefs::instance()->mEx2PhoneConnection,
KPimGlobalPrefs::instance()->mEx2PhoneModel );
+ QStringList uids = mViewManager->selectedUids();
+ if ( uids.isEmpty() )
+ return;
+#ifdef _WIN32_
+ QString fileName = locateLocal("tmp", "tempfile.vcf");
+#else
+ QString fileName = "/tmp/kdepimtemp.vcf";
+#endif
-
-
- QString fileName = "/tmp/kapibeamfile.vcf";
-
-
- //QDir().mkdir( dirName, true );
-
-
KABC::VCardConverter converter;
QString description;
QString datastream;
@@ -718,7 +719,6 @@ void KABCore::export2phone()
}
datastream += vcard.mid( start,vcard.length() );
}
-#ifndef DESKTOP_VERSION
QFile outFile(fileName);
if ( outFile.open(IO_WriteOnly) ) {
datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
@@ -726,17 +726,13 @@ void KABCore::export2phone()
t.setEncoding( QTextStream::UnicodeUTF8 );
t <<datastream;
outFile.close();
- Ir *ir = new Ir( this );
- connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
- ir->send( fileName, description, "text/x-vCard" );
} else {
- qDebug("Error open temp beam file ");
+ qDebug("Error open temp file ");
return;
}
-#endif
-
+#if 0
setCaption( i18n("Writing to phone..."));
if ( PhoneFormat::writeToPhone( cal ) )