author | zautrix <zautrix> | 2004-10-27 12:27:39 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-27 12:27:39 (UTC) |
commit | 2f3396d84d2f3c92e1e0e420d677892c1f9c0778 (patch) (side-by-side diff) | |
tree | 1ebab5dc6d00cb09720789897ce2c86df05cc9ab | |
parent | f73d249579d52d7aeaacde2dcb23abeb42f9ee95 (diff) | |
download | kdepimpi-2f3396d84d2f3c92e1e0e420d677892c1f9c0778.zip kdepimpi-2f3396d84d2f3c92e1e0e420d677892c1f9c0778.tar.gz kdepimpi-2f3396d84d2f3c92e1e0e420d677892c1f9c0778.tar.bz2 |
completed KDE AB sync. but will it work ...?
-rw-r--r-- | kabc/addressbook.cpp | 7 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 23 | ||||
-rw-r--r-- | kaddressbook/viewmanager.cpp | 5 | ||||
-rw-r--r-- | kaddressbook/viewmanager.h | 1 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 15 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 22 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 2 |
8 files changed, 61 insertions, 15 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index d101589..9b196b5 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -864,4 +864,7 @@ void AddressBook::removeSyncAddressees( bool removeDeleted ) (*it).setRevision( dt ); - (*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" ); - (*it).setIDStr(""); + if (( *it).IDStr() != "changed" ) { + // "changed" is used for tagging changed addressees when syncing with KDE or OL + (*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" ); + (*it).setIDStr(""); + } if ( ( (*it).tempSyncStat() == SYNC_TEMPSTATE_DELETE && removeDeleted )|| (*it).uid().left( 19 ) == QString("last-syncAddressee-")) { diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 2f00a09..ea87929 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1314,2 +1314,3 @@ void KABCore::setDetailsVisible( bool visible ) mDetails->show(); + mIncSearchWidget->setFocus(); } @@ -1318,2 +1319,3 @@ void KABCore::setDetailsVisible( bool visible ) mDetails->hide(); + mViewManager->setFocusAV(); } @@ -2046,2 +2048,5 @@ void KABCore::addActionsManually() } + } else { + if (KABPrefs::instance()->mMultipleViewsAtOnce ) + mActionSave->plug( tb ); } @@ -2509,3 +2514,12 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo mLastAddressbookSync = QDateTime::currentDateTime(); - QDateTime modifiedCalendar = mLastAddressbookSync;; + if ( syncManager->syncWithDesktop() ) { + remote->removeSyncInfo( QString());//remove all info + if ( KSyncManager::mRequestedSyncEvent.isValid() ) { + mLastAddressbookSync = KSyncManager::mRequestedSyncEvent; + qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() ); + } else { + qDebug("ERROR: KSyncManager::mRequestedSyncEvent has invalid datatime "); + } + } + QDateTime modifiedCalendar = mLastAddressbookSync; addresseeLSync = getLastSyncAddressee(); @@ -2607,2 +2621,4 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo inR.setExternalUID( idS ); + if ( syncManager->syncWithDesktop() ) + inR.setIDStr( "changed" ); } else { @@ -2899,3 +2915,6 @@ void KABCore::getFile( bool success ) void KABCore::syncFileRequest() -{ +{ + if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { + syncManager->slotSyncMenu( 999 ); + } mAddressBook->export2File( sentSyncFile() ); diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index f4fb08b..81e0d99 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp @@ -302,2 +302,7 @@ void ViewManager::refreshView( const QString &uid ) +void ViewManager::setFocusAV() +{ + if ( mActiveView ) + mActiveView->setFocus(); +} void ViewManager::editView() diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h index 585f4e9..a03a83f 100644 --- a/kaddressbook/viewmanager.h +++ b/kaddressbook/viewmanager.h @@ -66,2 +66,3 @@ class ViewManager : public QWidget void setListSelected(QStringList); + void setFocusAV(); diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 326db88..6e61351 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -929,3 +929,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mLastCalendarSync = QDateTime::currentDateTime(); - if ( mSyncKDE ) { + if ( mSyncManager->syncWithDesktop() ) { remote->resetPilotStat(1); @@ -946,3 +946,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } else { - if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncKDE) { + if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { eventRSync = (Event*)eventLSync->clone(); @@ -969,3 +969,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } - if ( mSyncKDE ) { + if ( mSyncManager->syncWithDesktop() ) { fullDateRange = ( eventLSync->dtStart() == mLastCalendarSync ); @@ -1029,3 +1029,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int remote->addIncidence( inR ); - if ( mSyncKDE ) + if ( mSyncManager->syncWithDesktop() ) inR->setPilotId( 2 ); @@ -1037,3 +1037,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int inL = inR->clone(); - if ( mSyncKDE ) + if ( mSyncManager->syncWithDesktop() ) inL->setPilotId( pid ); @@ -1185,3 +1185,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int eventLSync->setReadOnly( true ); - if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncKDE) // kde is abnormal... + if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... remote->addEvent( eventRSync ); @@ -3747,6 +3747,4 @@ bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) // mSyncManager = manager; - mSyncKDE = false; if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { qDebug("SyncKDE request detected!"); - mSyncKDE = true; } @@ -3758,3 +3756,2 @@ bool CalendarView::syncExternal(KSyncManager* manager, QString resource) { - mSyncKDE = false; //mSyncManager = manager; diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index acc20d6..437a51c 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -491,3 +491,2 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser private: - bool mSyncKDE; KSyncManager* mSyncManager; diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index e09050e..17e6c75 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -189,2 +189,3 @@ void KSyncManager::slotSyncMenu( int action ) return; + mSyncWithDesktop = false; if ( action == 0 ) { @@ -253,2 +254,3 @@ void KSyncManager::slotSyncMenu( int action ) if ( action == 1000 ) { + mIsKapiFile = false; #ifdef DESKTOP_VERSION @@ -884,2 +886,3 @@ void KSyncManager::syncKDE() { + mSyncWithDesktop = true; emit save(); @@ -888,3 +891,20 @@ void KSyncManager::syncKDE() case (KAPI): - + { +#ifdef DESKTOP_VERSION + QString command = qApp->applicationDirPath () + "/kdeabdump"; +#else + QString command = "kdeabdump"; +#endif + if ( ! QFile::exists ( command ) ) + command = "kdeabdump"; + QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf"; + system ( command.latin1()); + if ( syncWithFile( fileName,true ) ) { + if ( mWriteBackFile ) { + command += " --read"; + system ( command.latin1()); + } + } + + } break; diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 2af891b..6da0ee4 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h @@ -124,2 +124,3 @@ class KSyncManager : public QObject + bool syncWithDesktop () { return mSyncWithDesktop;} QString getCurrentSyncDevice() { return mCurrentSyncDevice; } @@ -189,2 +190,3 @@ class KSyncManager : public QObject QProgressBar* bar; + bool mSyncWithDesktop; |