-rw-r--r-- | kabc/addressbook.cpp | 1 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 2 |
3 files changed, 2 insertions, 3 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 295cf03..03a86f9 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -405,25 +405,24 @@ void AddressBook::importFromFile( QString fileName ) | |||
405 | { | 405 | { |
406 | 406 | ||
407 | KABC::Addressee::List list; | 407 | KABC::Addressee::List list; |
408 | QFile file( fileName ); | 408 | QFile file( fileName ); |
409 | 409 | ||
410 | file.open( IO_ReadOnly ); | 410 | file.open( IO_ReadOnly ); |
411 | QByteArray rawData = file.readAll(); | 411 | QByteArray rawData = file.readAll(); |
412 | file.close(); | 412 | file.close(); |
413 | 413 | ||
414 | QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); | 414 | QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); |
415 | KABC::VCardTool tool; | 415 | KABC::VCardTool tool; |
416 | list = tool.parseVCards( data ); | 416 | list = tool.parseVCards( data ); |
417 | |||
418 | KABC::Addressee::List::Iterator it; | 417 | KABC::Addressee::List::Iterator it; |
419 | for ( it = list.begin(); it != list.end(); ++it ) { | 418 | for ( it = list.begin(); it != list.end(); ++it ) { |
420 | (*it).setResource( 0 ); | 419 | (*it).setResource( 0 ); |
421 | insertAddressee( (*it), false, true ); | 420 | insertAddressee( (*it), false, true ); |
422 | } | 421 | } |
423 | 422 | ||
424 | } | 423 | } |
425 | 424 | ||
426 | bool AddressBook::saveAB() | 425 | bool AddressBook::saveAB() |
427 | { | 426 | { |
428 | bool ok = true; | 427 | bool ok = true; |
429 | 428 | ||
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index fa80f5c..12502b0 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2849,32 +2849,32 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource) | |||
2849 | } | 2849 | } |
2850 | } | 2850 | } |
2851 | setModified(); | 2851 | setModified(); |
2852 | } | 2852 | } |
2853 | if ( syncOK ) | 2853 | if ( syncOK ) |
2854 | mViewManager->refreshView(); | 2854 | mViewManager->refreshView(); |
2855 | return syncOK; | 2855 | return syncOK; |
2856 | 2856 | ||
2857 | } | 2857 | } |
2858 | 2858 | ||
2859 | void KABCore::getFile( bool success ) | 2859 | void KABCore::getFile( bool success ) |
2860 | { | 2860 | { |
2861 | qDebug("KABCore::getFile "); | ||
2862 | QTimer::singleShot( 15000, this , SLOT ( setCaptionBack())); | 2861 | QTimer::singleShot( 15000, this , SLOT ( setCaptionBack())); |
2863 | if ( ! success ) { | 2862 | if ( ! success ) { |
2864 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2863 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2865 | return; | 2864 | return; |
2866 | } | 2865 | } |
2867 | mAddressBook->importFromFile( sentSyncFile() ); | 2866 | mAddressBook->importFromFile( sentSyncFile() ); |
2868 | topLevelWidget()->setCaption( i18n("Pi-Sync successful!") ); | 2867 | topLevelWidget()->setCaption( i18n("Pi-Sync successful!") ); |
2868 | mViewManager->refreshView(); | ||
2869 | } | 2869 | } |
2870 | void KABCore::syncFileRequest() | 2870 | void KABCore::syncFileRequest() |
2871 | { | 2871 | { |
2872 | mAddressBook->export2File( sentSyncFile() ); | 2872 | mAddressBook->export2File( sentSyncFile() ); |
2873 | } | 2873 | } |
2874 | QString KABCore::sentSyncFile() | 2874 | QString KABCore::sentSyncFile() |
2875 | { | 2875 | { |
2876 | #ifdef _WIN32_ | 2876 | #ifdef _WIN32_ |
2877 | return locateLocal( "tmp", "copysyncab.vcf" ); | 2877 | return locateLocal( "tmp", "copysyncab.vcf" ); |
2878 | #else | 2878 | #else |
2879 | return QString( "/tmp/copysyncab.vcf" ); | 2879 | return QString( "/tmp/copysyncab.vcf" ); |
2880 | #endif | 2880 | #endif |
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index aad48d9..32400af 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -113,25 +113,24 @@ class KSyncManager : public QObject | |||
113 | KAPI = 1, | 113 | KAPI = 1, |
114 | PWMPI = 2 }; | 114 | PWMPI = 2 }; |
115 | 115 | ||
116 | 116 | ||
117 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); | 117 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); |
118 | ~KSyncManager() ; | 118 | ~KSyncManager() ; |
119 | 119 | ||
120 | bool blockSave() { return mBlockSaveFlag; } | 120 | bool blockSave() { return mBlockSaveFlag; } |
121 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } | 121 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } |
122 | void setDefaultFileName( QString s) { mDefFileName = s ;} | 122 | void setDefaultFileName( QString s) { mDefFileName = s ;} |
123 | QString defaultFileName() { return mDefFileName ;} | 123 | QString defaultFileName() { return mDefFileName ;} |
124 | QString syncFileName(); | 124 | QString syncFileName(); |
125 | void fillSyncMenu(); | ||
126 | 125 | ||
127 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } | 126 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } |
128 | QString getCurrentSyncName() { return mCurrentSyncName; } | 127 | QString getCurrentSyncName() { return mCurrentSyncName; } |
129 | 128 | ||
130 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); | 129 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); |
131 | void hideProgressBar(); | 130 | void hideProgressBar(); |
132 | bool isProgressBarCanceled(); | 131 | bool isProgressBarCanceled(); |
133 | 132 | ||
134 | // sync stuff | 133 | // sync stuff |
135 | QString mLocalMachineName; | 134 | QString mLocalMachineName; |
136 | QStringList mExternSyncProfiles; | 135 | QStringList mExternSyncProfiles; |
137 | QStringList mSyncProfileNames; | 136 | QStringList mSyncProfileNames; |
@@ -149,24 +148,25 @@ class KSyncManager : public QObject | |||
149 | QString mPhoneModel; | 148 | QString mPhoneModel; |
150 | QString mLastSyncedLocalFile; // save! | 149 | QString mLastSyncedLocalFile; // save! |
151 | QString mPassWordPiSync; | 150 | QString mPassWordPiSync; |
152 | QString mActiveSyncPort; | 151 | QString mActiveSyncPort; |
153 | QString mActiveSyncIP ; | 152 | QString mActiveSyncIP ; |
154 | 153 | ||
155 | signals: | 154 | signals: |
156 | void save(); | 155 | void save(); |
157 | void request_file(); | 156 | void request_file(); |
158 | void getFile( bool ); | 157 | void getFile( bool ); |
159 | 158 | ||
160 | public slots: | 159 | public slots: |
160 | void fillSyncMenu(); | ||
161 | void slotSyncMenu( int ); | 161 | void slotSyncMenu( int ); |
162 | void deleteCommandSocket(KCommandSocket*s, int state); | 162 | void deleteCommandSocket(KCommandSocket*s, int state); |
163 | void readFileFromSocket(); | 163 | void readFileFromSocket(); |
164 | 164 | ||
165 | private: | 165 | private: |
166 | // LR ******************************* | 166 | // LR ******************************* |
167 | // sync stuff! | 167 | // sync stuff! |
168 | void syncPi(); | 168 | void syncPi(); |
169 | KServerSocket * mServerSocket; | 169 | KServerSocket * mServerSocket; |
170 | void enableQuick(); | 170 | void enableQuick(); |
171 | KPimPrefs* mPrefs; | 171 | KPimPrefs* mPrefs; |
172 | QString mDefFileName; | 172 | QString mDefFileName; |