-rw-r--r-- | bin/kdepim/korganizer/kopiWhatsNew.txt | 8 | ||||
-rw-r--r-- | kabc/addressbook.cpp | 16 | ||||
-rw-r--r-- | kabc/addressbook.h | 2 | ||||
-rw-r--r-- | kabc/addressee.cpp | 17 | ||||
-rw-r--r-- | kabc/addressee.h | 1 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 22 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 1 | ||||
-rw-r--r-- | kaddressbook/kaddressbookmain.cpp | 12 | ||||
-rw-r--r-- | kaddressbook/kaddressbookmain.h | 2 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 8 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 15 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 6 |
12 files changed, 79 insertions, 31 deletions
diff --git a/bin/kdepim/korganizer/kopiWhatsNew.txt b/bin/kdepim/korganizer/kopiWhatsNew.txt index eea860c..3f95dcf 100644 --- a/bin/kdepim/korganizer/kopiWhatsNew.txt +++ b/bin/kdepim/korganizer/kopiWhatsNew.txt | |||
@@ -13,13 +13,19 @@ application/config data should be saved. | |||
13 | An easy Kx/Pi to Kx/Pi syncing is now possible | 13 | An easy Kx/Pi to Kx/Pi syncing is now possible |
14 | (it is called Pi-Sync) via network. | 14 | (it is called Pi-Sync) via network. |
15 | Please look at the Sync Howto. | 15 | Please look at the Sync Howto. |
16 | 16 | ||
17 | Exporting of data to mobile phones is now possible. | 17 | Exporting of calendar data and contacts to mobile phones is now possible. |
18 | The SyncHowto is updated with information howto | 18 | The SyncHowto is updated with information howto |
19 | access/sync mobile phones. | 19 | access/sync mobile phones. |
20 | Please look at the Sync Howto. | 20 | Please look at the Sync Howto. |
21 | 21 | ||
22 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. | ||
23 | Please disable Fastload for the original contact/calendar applications | ||
24 | and close them. | ||
25 | KO/Pi and KA/Pi must be running in order to receive the data. | ||
26 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) | ||
27 | |||
22 | 28 | ||
23 | ********** VERSION 1.9.6 ************ | 29 | ********** VERSION 1.9.6 ************ |
24 | 30 | ||
25 | Changes in the external application communication on the Zaurus | 31 | Changes in the external application communication on the Zaurus |
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index dc3cda1..bf6d053 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -401,24 +401,32 @@ void AddressBook::export2File( QString fileName ) | |||
401 | } | 401 | } |
402 | t << "\r\n\r\n"; | 402 | t << "\r\n\r\n"; |
403 | outFile.close(); | 403 | outFile.close(); |
404 | } | 404 | } |
405 | void AddressBook::importFromFile( QString fileName ) | 405 | void AddressBook::importFromFile( QString fileName, bool replaceLabel ) |
406 | { | 406 | { |
407 | 407 | ||
408 | KABC::Addressee::List list; | 408 | KABC::Addressee::List list; |
409 | QFile file( fileName ); | 409 | QFile file( fileName ); |
410 | 410 | ||
411 | file.open( IO_ReadOnly ); | 411 | file.open( IO_ReadOnly ); |
412 | QByteArray rawData = file.readAll(); | 412 | QByteArray rawData = file.readAll(); |
413 | file.close(); | 413 | file.close(); |
414 | 414 | qDebug("AddressBook::importFromFile "); | |
415 | QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); | 415 | QString data; |
416 | if ( replaceLabel ) { | ||
417 | data = QString::fromLatin1( rawData.data(), rawData.size() + 1 ); | ||
418 | data.replace ( QRegExp("LABEL") , "ADR" ); | ||
419 | data.replace ( QRegExp("CHARSET=ISO-8859-1") , "" ); | ||
420 | } else | ||
421 | data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); | ||
416 | KABC::VCardTool tool; | 422 | KABC::VCardTool tool; |
417 | list = tool.parseVCards( data ); | 423 | list = tool.parseVCards( data ); |
418 | KABC::Addressee::List::Iterator it; | 424 | KABC::Addressee::List::Iterator it; |
419 | for ( it = list.begin(); it != list.end(); ++it ) { | 425 | for ( it = list.begin(); it != list.end(); ++it ) { |
420 | (*it).setResource( 0 ); | 426 | (*it).setResource( 0 ); |
427 | if ( replaceLabel ) | ||
428 | (*it).removeVoice(); | ||
421 | insertAddressee( (*it), false, true ); | 429 | insertAddressee( (*it), false, true ); |
422 | } | 430 | } |
423 | 431 | ||
424 | } | 432 | } |
diff --git a/kabc/addressbook.h b/kabc/addressbook.h index 3603ec1..cea1b03 100644 --- a/kabc/addressbook.h +++ b/kabc/addressbook.h | |||
@@ -142,9 +142,9 @@ class AddressBook : public QObject | |||
142 | */ | 142 | */ |
143 | bool save( Ticket *ticket ); | 143 | bool save( Ticket *ticket ); |
144 | bool saveAB( ); | 144 | bool saveAB( ); |
145 | void export2File( QString fileName ); | 145 | void export2File( QString fileName ); |
146 | void importFromFile( QString fileName ); | 146 | void importFromFile( QString fileName, bool replaceLabel = false ); |
147 | /** | 147 | /** |
148 | Returns a iterator for first entry of address book. | 148 | Returns a iterator for first entry of address book. |
149 | */ | 149 | */ |
150 | Iterator begin(); | 150 | Iterator begin(); |
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 19a1845..3f3d5c0 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -314,8 +314,25 @@ void Addressee::mergeContact( const Addressee& ad ) | |||
314 | setUid( ad.uid() ); | 314 | setUid( ad.uid() ); |
315 | setRevision( ad.revision() ); | 315 | setRevision( ad.revision() ); |
316 | } | 316 | } |
317 | 317 | ||
318 | bool Addressee::removeVoice() | ||
319 | { | ||
320 | PhoneNumber::List phoneN = phoneNumbers(); | ||
321 | PhoneNumber::List::Iterator phoneIt; | ||
322 | bool found = false; | ||
323 | for ( phoneIt = phoneN.begin(); phoneIt != phoneN.end(); ++phoneIt ) { | ||
324 | if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found | ||
325 | if ((*phoneIt).type() - PhoneNumber::Voice ) { | ||
326 | (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); | ||
327 | insertPhoneNumber( (*phoneIt) ); | ||
328 | found = true; | ||
329 | } | ||
330 | } | ||
331 | |||
332 | } | ||
333 | return found; | ||
334 | } | ||
318 | void Addressee::simplifyAddresses() | 335 | void Addressee::simplifyAddresses() |
319 | { | 336 | { |
320 | if ( mData->addresses.count() < 3 ) return ; | 337 | if ( mData->addresses.count() < 3 ) return ; |
321 | int count = 0; | 338 | int count = 0; |
diff --git a/kabc/addressee.h b/kabc/addressee.h index 44f0629..9336edc 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h | |||
@@ -120,8 +120,9 @@ class Addressee | |||
120 | void simplifyEmails(); | 120 | void simplifyEmails(); |
121 | void simplifyAddresses(); | 121 | void simplifyAddresses(); |
122 | void simplifyPhoneNumbers(); | 122 | void simplifyPhoneNumbers(); |
123 | void simplifyPhoneNumberTypes(); | 123 | void simplifyPhoneNumberTypes(); |
124 | bool removeVoice(); | ||
124 | 125 | ||
125 | /** | 126 | /** |
126 | Set unique identifier. | 127 | Set unique identifier. |
127 | */ | 128 | */ |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 9b059d3..3a542ba 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -324,8 +324,14 @@ KABCore::~KABCore() | |||
324 | delete syncManager; | 324 | delete syncManager; |
325 | 325 | ||
326 | } | 326 | } |
327 | 327 | ||
328 | void KABCore::recieve( QString fn ) | ||
329 | { | ||
330 | qDebug("KABCore::recieve "); | ||
331 | mAddressBook->importFromFile( fn, true ); | ||
332 | topLevelWidget()->raise(); | ||
333 | } | ||
328 | void KABCore::restoreSettings() | 334 | void KABCore::restoreSettings() |
329 | { | 335 | { |
330 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 336 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
331 | 337 | ||
@@ -2085,22 +2091,10 @@ void KABCore::removeVoice() | |||
2085 | return; | 2091 | return; |
2086 | KABC::Addressee::List list = mViewManager->selectedAddressees(); | 2092 | KABC::Addressee::List list = mViewManager->selectedAddressees(); |
2087 | KABC::Addressee::List::Iterator it; | 2093 | KABC::Addressee::List::Iterator it; |
2088 | for ( it = list.begin(); it != list.end(); ++it ) { | 2094 | for ( it = list.begin(); it != list.end(); ++it ) { |
2089 | PhoneNumber::List phoneNumbers = (*it).phoneNumbers(); | 2095 | |
2090 | PhoneNumber::List::Iterator phoneIt; | 2096 | if ( (*it).removeVoice() ) |
2091 | bool found = false; | ||
2092 | for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { | ||
2093 | if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found | ||
2094 | if ((*phoneIt).type() - PhoneNumber::Voice ) { | ||
2095 | (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); | ||
2096 | (*it).insertPhoneNumber( (*phoneIt) ); | ||
2097 | found = true; | ||
2098 | } | ||
2099 | } | ||
2100 | |||
2101 | } | ||
2102 | if ( found ) | ||
2103 | contactModified((*it) ); | 2097 | contactModified((*it) ); |
2104 | } | 2098 | } |
2105 | } | 2099 | } |
2106 | 2100 | ||
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index c628399..43c5f99 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -341,8 +341,9 @@ class KABCore : public QWidget, public KSyncInterface | |||
341 | signals: | 341 | signals: |
342 | void contactSelected( const QString &name ); | 342 | void contactSelected( const QString &name ); |
343 | void contactSelected( const QPixmap &pixmap ); | 343 | void contactSelected( const QPixmap &pixmap ); |
344 | public slots: | 344 | public slots: |
345 | void recieve(QString cmsg ); | ||
345 | void getFile( bool success ); | 346 | void getFile( bool success ); |
346 | void syncFileRequest(); | 347 | void syncFileRequest(); |
347 | void setDetailsVisible( bool visible ); | 348 | void setDetailsVisible( bool visible ); |
348 | void setDetailsToState(); | 349 | void setDetailsToState(); |
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index f48f214..8c4ca09 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp | |||
@@ -91,9 +91,19 @@ KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainW | |||
91 | KAddressBookMain::~KAddressBookMain() | 91 | KAddressBookMain::~KAddressBookMain() |
92 | { | 92 | { |
93 | // mCore->saveSettings(); | 93 | // mCore->saveSettings(); |
94 | } | 94 | } |
95 | 95 | void KAddressBookMain::recieve( const QCString& cmsg, const QByteArray& data ) | |
96 | { | ||
97 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); | ||
98 | if ( cmsg == "setDocument(QString)" ) { | ||
99 | QDataStream stream( data, IO_ReadOnly ); | ||
100 | QString fileName; | ||
101 | stream >> fileName; | ||
102 | mCore->recieve( fileName ); | ||
103 | return; | ||
104 | } | ||
105 | } | ||
96 | void KAddressBookMain::showMinimized () | 106 | void KAddressBookMain::showMinimized () |
97 | { | 107 | { |
98 | QWidget::showMinimized () ; | 108 | QWidget::showMinimized () ; |
99 | } | 109 | } |
diff --git a/kaddressbook/kaddressbookmain.h b/kaddressbook/kaddressbookmain.h index cf6f899..40d2bdd 100644 --- a/kaddressbook/kaddressbookmain.h +++ b/kaddressbook/kaddressbookmain.h | |||
@@ -80,9 +80,9 @@ class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface | |||
80 | virtual void newContact(); | 80 | virtual void newContact(); |
81 | virtual QString getNameByPhone( QString phone ); | 81 | virtual QString getNameByPhone( QString phone ); |
82 | virtual void save(); | 82 | virtual void save(); |
83 | virtual void exit(); | 83 | virtual void exit(); |
84 | 84 | void recieve( const QCString& cmsg, const QByteArray& data ); | |
85 | protected: | 85 | protected: |
86 | void initActions(); | 86 | void initActions(); |
87 | #ifdef KAB_EMBEDDED | 87 | #ifdef KAB_EMBEDDED |
88 | //US new method to setup menues and toolbars on embedded systems | 88 | //US new method to setup menues and toolbars on embedded systems |
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 965fb06..6dd97b8 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef DESKTOP_VERSION | 1 | #ifndef DESKTOP_VERSION |
2 | #include <qpe/qpeapplication.h> | 2 | #include <qpe/qpeapplication.h> |
3 | #include <qcopchannel_qws.h> | ||
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
4 | #else | 5 | #else |
5 | #include <qapplication.h> | 6 | #include <qapplication.h> |
6 | #include <qwindowsstyle.h> | 7 | #include <qwindowsstyle.h> |
@@ -76,15 +77,20 @@ int main( int argc, char **argv ) | |||
76 | { | 77 | { |
77 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 78 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
78 | } | 79 | } |
79 | #ifndef DESKTOP_VERSION | 80 | #ifndef DESKTOP_VERSION |
80 | a.showMainWidget( &m ); | 81 | a.showMainWidget( &m ); |
82 | QCopChannel* c1 = new QCopChannel("QPE/Application/addressbook",&m, "channelAB" ) ; | ||
83 | QObject::connect( c1, SIGNAL (received ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | ||
81 | #else | 84 | #else |
82 | a.setMainWidget( &m ); | 85 | a.setMainWidget( &m ); |
83 | m.resize (640, 480 ); | 86 | m.resize (640, 480 ); |
84 | m.show(); | 87 | m.show(); |
85 | #endif | 88 | #endif |
86 | a.exec(); | 89 | a.exec(); |
90 | #ifndef DESKTOP_VERSION | ||
91 | delete c1; | ||
92 | #endif | ||
87 | 93 | ||
88 | } | 94 | } |
89 | qDebug("KA: Bye! "); | 95 | qDebug("KA: Bye! "); |
90 | } | 96 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 3c16458..a69a0bd 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -333,15 +333,16 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
333 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 333 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
334 | //QString datamess; | 334 | //QString datamess; |
335 | //qDebug("message "); | 335 | //qDebug("message "); |
336 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 336 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
337 | 337 | ||
338 | if ( cmsg == "-writeFile" ) { | 338 | if ( cmsg == "setDocument(QString)" ) { |
339 | // I made from the "-writeFile" an "-writeAlarm" | 339 | QDataStream stream( data, IO_ReadOnly ); |
340 | mView->viewManager()->showWhatsNextView(); | 340 | QString fileName; |
341 | mCalendar->checkAlarmForIncidence( 0, true); | 341 | stream >> fileName; |
342 | showMaximized(); | 342 | qDebug("filename %s ", fileName.latin1()); |
343 | raise(); | 343 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
344 | mSyncManager->slotSyncMenu( 1002 ); | ||
344 | return; | 345 | return; |
345 | } | 346 | } |
346 | 347 | ||
347 | if ( cmsg == "-writeFile" ) { | 348 | if ( cmsg == "-writeFile" ) { |
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 08b1a3d..80fb147 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -190,8 +190,12 @@ void KSyncManager::slotSyncMenu( int action ) | |||
190 | } else if ( action == 1001 ) { | 190 | } else if ( action == 1001 ) { |
191 | syncLocalFile(); | 191 | syncLocalFile(); |
192 | 192 | ||
193 | } else if ( action == 1002 ) { | 193 | } else if ( action == 1002 ) { |
194 | mWriteBackFile = false; | ||
195 | mAskForPreferences = false; | ||
196 | mShowSyncSummary = false; | ||
197 | mSyncAlgoPrefs = 3; | ||
194 | quickSyncLocalFile(); | 198 | quickSyncLocalFile(); |
195 | 199 | ||
196 | } else if ( action >= 1003 ) { | 200 | } else if ( action >= 1003 ) { |
197 | if ( temp->getIsLocalFileSync() ) { | 201 | if ( temp->getIsLocalFileSync() ) { |
@@ -365,9 +369,9 @@ bool KSyncManager::syncWithFile( QString fn , bool quick ) | |||
365 | 369 | ||
366 | void KSyncManager::quickSyncLocalFile() | 370 | void KSyncManager::quickSyncLocalFile() |
367 | { | 371 | { |
368 | 372 | ||
369 | if ( syncWithFile( mPrefs->mLastSyncedLocalFile, false ) ) { | 373 | if ( syncWithFile( mPrefs->mLastSyncedLocalFile, true ) ) { |
370 | qDebug("quick syncLocalFile() successful "); | 374 | qDebug("quick syncLocalFile() successful "); |
371 | 375 | ||
372 | } | 376 | } |
373 | } | 377 | } |