summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp45
1 files changed, 19 insertions, 26 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index dae9cd2..087e9e3 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -694,29 +694,26 @@ void KABCore::export2phone()
return;
+ QString fileName = getPhoneFile();
+ if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) )
+ return;
+
+ QTimer::singleShot( 1, this , SLOT ( writeToPhone()));
+
+}
+QString KABCore::getPhoneFile()
+{
#ifdef _WIN32_
- QString fileName = locateLocal("tmp", "phonefile.vcf");
+ return locateLocal("tmp", "phonefile.vcf");
#else
- QString fileName = "/tmp/phonefile.vcf";
+ return "/tmp/phonefile.vcf";
#endif
- if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) )
- return;
-
- if ( PhoneAccess::writeToPhone( fileName ) )
- qDebug("Export okay ");
- else
- qDebug("Error export contacts ");
-
-
-#if 0
-
- setCaption( i18n("Writing to phone..."));
- if ( PhoneFormat::writeToPhone( cal ) )
- setCaption( i18n("Export to phone successful!"));
+}
+void KABCore::writeToPhone( )
+{
+ if ( PhoneAccess::writeToPhone( getPhoneFile() ) )
+ qDebug("Export okay ");
else
- setCaption( i18n("Error exporting to phone!"));
-#endif
-
-
+ qDebug("Error export contacts ");
}
void KABCore::beamVCard()
@@ -835,4 +832,5 @@ void KABCore::beamDone( Ir *ir )
#endif
topLevelWidget()->raise();
+ message( i18n("Beaming successful!") );
}
@@ -2819,10 +2817,5 @@ bool KABCore::syncPhone()
{
QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
- QString fileName;
-#ifdef _WIN32_
- fileName = locateLocal("tmp", "phonefile.vcf");
-#else
- fileName = "/tmp/phonefile.vcf";
-#endif
+ QString fileName = getPhoneFile();
if ( !PhoneAccess::readFromPhone( fileName) ) {
message(i18n("Phone access failed!"));