summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp41
1 files changed, 17 insertions, 24 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index dae9cd2..087e9e3 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -695,12 +695,21 @@ void KABCore::export2phone()
+ 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 ) )
+}
+void KABCore::writeToPhone( )
+{
+ if ( PhoneAccess::writeToPhone( getPhoneFile() ) )
qDebug("Export okay ");
@@ -708,14 +717,2 @@ void KABCore::export2phone()
qDebug("Error export contacts ");
-
-
-#if 0
-
- setCaption( i18n("Writing to phone..."));
- if ( PhoneFormat::writeToPhone( cal ) )
- setCaption( i18n("Export to phone successful!"));
- else
- setCaption( i18n("Error exporting to phone!"));
-#endif
-
-
}
@@ -836,2 +833,3 @@ void KABCore::beamDone( Ir *ir )
topLevelWidget()->raise();
+ message( i18n("Beaming successful!") );
}
@@ -2820,8 +2818,3 @@ 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) ) {