summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressbook.cpp1
-rw-r--r--kaddressbook/kabcore.cpp3
-rw-r--r--libkdepim/phoneaccess.cpp6
3 files changed, 8 insertions, 2 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index 1a06956..1050f55 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -19,48 +19,49 @@
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28/*US 28/*US
29 29
30#include <qfile.h> 30#include <qfile.h>
31#include <qregexp.h> 31#include <qregexp.h>
32#include <qtimer.h> 32#include <qtimer.h>
33 33
34#include <kapplication.h> 34#include <kapplication.h>
35#include <kinstance.h> 35#include <kinstance.h>
36#include <kstandarddirs.h> 36#include <kstandarddirs.h>
37 37
38#include "errorhandler.h" 38#include "errorhandler.h"
39*/ 39*/
40#include <qptrlist.h> 40#include <qptrlist.h>
41#include <qtextstream.h> 41#include <qtextstream.h>
42#include <qfile.h> 42#include <qfile.h>
43#include <qregexp.h>
43 44
44#include <kglobal.h> 45#include <kglobal.h>
45#include <klocale.h> 46#include <klocale.h>
46#include <kmessagebox.h> 47#include <kmessagebox.h>
47#include <kdebug.h> 48#include <kdebug.h>
48#include <libkcal/syncdefines.h> 49#include <libkcal/syncdefines.h>
49#include "addressbook.h" 50#include "addressbook.h"
50#include "resource.h" 51#include "resource.h"
51#include "vcardconverter.h" 52#include "vcardconverter.h"
52#include "vcardparser/vcardtool.h" 53#include "vcardparser/vcardtool.h"
53 54
54//US #include "addressbook.moc" 55//US #include "addressbook.moc"
55 56
56using namespace KABC; 57using namespace KABC;
57 58
58struct AddressBook::AddressBookData 59struct AddressBook::AddressBookData
59{ 60{
60 Addressee::List mAddressees; 61 Addressee::List mAddressees;
61 Addressee::List mRemovedAddressees; 62 Addressee::List mRemovedAddressees;
62 Field::List mAllFields; 63 Field::List mAllFields;
63 KConfig *mConfig; 64 KConfig *mConfig;
64 KRES::Manager<Resource> *mManager; 65 KRES::Manager<Resource> *mManager;
65//US ErrorHandler *mErrorHandler; 66//US ErrorHandler *mErrorHandler;
66}; 67};
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index efcd492..7ec3fca 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2788,49 +2788,50 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
2788 } 2788 }
2789 2789
2790 if ( external ) { 2790 if ( external ) {
2791 qDebug("Setting vcf mode to external "); 2791 qDebug("Setting vcf mode to external ");
2792 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 2792 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
2793 AddressBook::Iterator it; 2793 AddressBook::Iterator it;
2794 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 2794 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
2795 (*it).setID( mCurrentSyncDevice, (*it).uid() ); 2795 (*it).setID( mCurrentSyncDevice, (*it).uid() );
2796 (*it).computeCsum( mCurrentSyncDevice ); 2796 (*it).computeCsum( mCurrentSyncDevice );
2797 } 2797 }
2798 } 2798 }
2799 } 2799 }
2800 //AddressBook::Iterator it; 2800 //AddressBook::Iterator it;
2801 //QStringList vcards; 2801 //QStringList vcards;
2802 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 2802 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
2803 // qDebug("Name %s ", (*it).familyName().latin1()); 2803 // qDebug("Name %s ", (*it).familyName().latin1());
2804 //} 2804 //}
2805 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); 2805 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode );
2806 if ( syncOK ) { 2806 if ( syncOK ) {
2807 if ( syncManager->mWriteBackFile ) 2807 if ( syncManager->mWriteBackFile )
2808 { 2808 {
2809 if ( external ) 2809 if ( external )
2810 abLocal.removeSyncAddressees( !isXML); 2810 abLocal.removeSyncAddressees( !isXML);
2811 qDebug("Saving remote AB "); 2811 qDebug("Saving remote AB ");
2812 abLocal.saveAB(); 2812 if ( ! abLocal.saveAB())
2813 qDebug("Error writing back AB to file ");
2813 if ( isXML ) { 2814 if ( isXML ) {
2814 // afterwrite processing 2815 // afterwrite processing
2815 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); 2816 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice );
2816 } 2817 }
2817 } 2818 }
2818 } 2819 }
2819 setModified(); 2820 setModified();
2820 2821
2821 } 2822 }
2822 if ( syncOK ) 2823 if ( syncOK )
2823 mViewManager->refreshView(); 2824 mViewManager->refreshView();
2824 return syncOK; 2825 return syncOK;
2825#if 0 2826#if 0
2826 2827
2827 if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) { 2828 if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) {
2828 getEventViewerDialog()->setSyncMode( true ); 2829 getEventViewerDialog()->setSyncMode( true );
2829 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 2830 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
2830 getEventViewerDialog()->setSyncMode( false ); 2831 getEventViewerDialog()->setSyncMode( false );
2831 if ( syncOK ) { 2832 if ( syncOK ) {
2832 if ( KOPrefs::instance()->mWriteBackFile ) 2833 if ( KOPrefs::instance()->mWriteBackFile )
2833 { 2834 {
2834 storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); 2835 storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) );
2835 storage->save(); 2836 storage->save();
2836 } 2837 }
diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp
index 357cd39..fe914dd 100644
--- a/libkdepim/phoneaccess.cpp
+++ b/libkdepim/phoneaccess.cpp
@@ -110,38 +110,42 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model
110 if ( addModel ) { 110 if ( addModel ) {
111 write = true; 111 write = true;
112 content += "model = "; 112 content += "model = ";
113 content += model; 113 content += model;
114 content += "\n"; 114 content += "\n";
115 } 115 }
116 if ( write ) { 116 if ( write ) {
117 if (!file.open( IO_WriteOnly ) ) { 117 if (!file.open( IO_WriteOnly ) ) {
118 qDebug("Error: cannot write file %s ", fileName.latin1() ); 118 qDebug("Error: cannot write file %s ", fileName.latin1() );
119 return; 119 return;
120 } 120 }
121 qDebug("Writing file %s ", fileName.latin1() ); 121 qDebug("Writing file %s ", fileName.latin1() );
122 QTextStream ts( &file ); 122 QTextStream ts( &file );
123 ts << content ; 123 ts << content ;
124 file.close(); 124 file.close();
125 } 125 }
126 126
127} 127}
128 128
129 129
130bool PhoneAccess::writeToPhone( QString fileName) 130bool PhoneAccess::writeToPhone( QString fileName)
131{ 131{
132 132
133#ifdef DESKTOP_VERSION 133#ifdef DESKTOP_VERSION
134#ifdef _WIN32_
135 QString command ="kammu --restore " + fileName ;
136#else
134 QString command ="./kammu --restore " + fileName ; 137 QString command ="./kammu --restore " + fileName ;
138#endif
135#else 139#else
136 QString command ="kammu --restore " + fileName ; 140 QString command ="kammu --restore " + fileName ;
137#endif 141#endif
138 int ret; 142 int ret;
139 while ( (ret = system ( command.latin1())) != 0 ) { 143 while ( (ret = system ( command.latin1())) != 0 ) {
140 qDebug("Error S::command returned %d. asking users", ret); 144 qDebug("Error S::command returned %d.", ret);
141 int retval = KMessageBox::warningContinueCancel(0, 145 int retval = KMessageBox::warningContinueCancel(0,
142 i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KO/Pi phone access"),i18n("Retry"),i18n("Cancel")); 146 i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KO/Pi phone access"),i18n("Retry"),i18n("Cancel"));
143 if ( retval != KMessageBox::Continue ) 147 if ( retval != KMessageBox::Continue )
144 return false; 148 return false;
145 } 149 }
146 return true; 150 return true;
147} 151}