summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressbook.cpp3
-rw-r--r--kaddressbook/kabcore.cpp21
-rw-r--r--kaddressbook/viewmanager.cpp5
-rw-r--r--kaddressbook/viewmanager.h1
-rw-r--r--korganizer/calendarview.cpp15
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--libkdepim/ksyncmanager.cpp20
-rw-r--r--libkdepim/ksyncmanager.h2
8 files changed, 57 insertions, 11 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index d101589..9b196b5 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -863,6 +863,9 @@ void AddressBook::removeSyncAddressees( bool removeDeleted )
863 while ( it != end() ) { 863 while ( it != end() ) {
864 (*it).setRevision( dt ); 864 (*it).setRevision( dt );
865 if (( *it).IDStr() != "changed" ) {
866 // "changed" is used for tagging changed addressees when syncing with KDE or OL
865 (*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" ); 867 (*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" );
866 (*it).setIDStr(""); 868 (*it).setIDStr("");
869 }
867 if ( ( (*it).tempSyncStat() == SYNC_TEMPSTATE_DELETE && removeDeleted )|| (*it).uid().left( 19 ) == QString("last-syncAddressee-")) { 870 if ( ( (*it).tempSyncStat() == SYNC_TEMPSTATE_DELETE && removeDeleted )|| (*it).uid().left( 19 ) == QString("last-syncAddressee-")) {
868 it2 = it; 871 it2 = it;
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 2f00a09..ea87929 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1313,8 +1313,10 @@ void KABCore::setDetailsVisible( bool visible )
1313 mViewManager->hide(); 1313 mViewManager->hide();
1314 mDetails->show(); 1314 mDetails->show();
1315 mIncSearchWidget->setFocus();
1315 } 1316 }
1316 else { 1317 else {
1317 mViewManager->show(); 1318 mViewManager->show();
1318 mDetails->hide(); 1319 mDetails->hide();
1320 mViewManager->setFocusAV();
1319 } 1321 }
1320 setJumpButtonBarVisible( !visible ); 1322 setJumpButtonBarVisible( !visible );
@@ -2045,4 +2047,7 @@ void KABCore::addActionsManually()
2045 mActionRedo->plug( tb ); 2047 mActionRedo->plug( tb );
2046 } 2048 }
2049 } else {
2050 if (KABPrefs::instance()->mMultipleViewsAtOnce )
2051 mActionSave->plug( tb );
2047 } 2052 }
2048 //mActionQuit->plug ( tb ); 2053 //mActionQuit->plug ( tb );
@@ -2508,5 +2513,14 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2508 local->resetTempSyncStat(); 2513 local->resetTempSyncStat();
2509 mLastAddressbookSync = QDateTime::currentDateTime(); 2514 mLastAddressbookSync = QDateTime::currentDateTime();
2510 QDateTime modifiedCalendar = mLastAddressbookSync;; 2515 if ( syncManager->syncWithDesktop() ) {
2516 remote->removeSyncInfo( QString());//remove all info
2517 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
2518 mLastAddressbookSync = KSyncManager::mRequestedSyncEvent;
2519 qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() );
2520 } else {
2521 qDebug("ERROR: KSyncManager::mRequestedSyncEvent has invalid datatime ");
2522 }
2523 }
2524 QDateTime modifiedCalendar = mLastAddressbookSync;
2511 addresseeLSync = getLastSyncAddressee(); 2525 addresseeLSync = getLastSyncAddressee();
2512 qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1()); 2526 qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1());
@@ -2606,4 +2620,6 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2606 inR.setOriginalExternalUID( OidS ); 2620 inR.setOriginalExternalUID( OidS );
2607 inR.setExternalUID( idS ); 2621 inR.setExternalUID( idS );
2622 if ( syncManager->syncWithDesktop() )
2623 inR.setIDStr( "changed" );
2608 } else { 2624 } else {
2609 inR.setIDStr( idS ); 2625 inR.setIDStr( idS );
@@ -2899,4 +2915,7 @@ void KABCore::getFile( bool success )
2899void KABCore::syncFileRequest() 2915void KABCore::syncFileRequest()
2900{ 2916{
2917 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) {
2918 syncManager->slotSyncMenu( 999 );
2919 }
2901 mAddressBook->export2File( sentSyncFile() ); 2920 mAddressBook->export2File( sentSyncFile() );
2902} 2921}
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index f4fb08b..81e0d99 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -301,4 +301,9 @@ void ViewManager::refreshView( const QString &uid )
301} 301}
302 302
303void ViewManager::setFocusAV()
304{
305 if ( mActiveView )
306 mActiveView->setFocus();
307}
303void ViewManager::editView() 308void ViewManager::editView()
304{ 309{
diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h
index 585f4e9..a03a83f 100644
--- a/kaddressbook/viewmanager.h
+++ b/kaddressbook/viewmanager.h
@@ -65,4 +65,5 @@ class ViewManager : public QWidget
65 KABC::Addressee::List selectedAddressees() const; 65 KABC::Addressee::List selectedAddressees() const;
66 void setListSelected(QStringList); 66 void setListSelected(QStringList);
67 void setFocusAV();
67 68
68 public slots: 69 public slots:
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 326db88..6e61351 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -928,5 +928,5 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
928 local->resetTempSyncStat(); 928 local->resetTempSyncStat();
929 mLastCalendarSync = QDateTime::currentDateTime(); 929 mLastCalendarSync = QDateTime::currentDateTime();
930 if ( mSyncKDE ) { 930 if ( mSyncManager->syncWithDesktop() ) {
931 remote->resetPilotStat(1); 931 remote->resetPilotStat(1);
932 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 932 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
@@ -945,5 +945,5 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
945 945
946 } else { 946 } else {
947 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncKDE) { 947 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) {
948 eventRSync = (Event*)eventLSync->clone(); 948 eventRSync = (Event*)eventLSync->clone();
949 } else { 949 } else {
@@ -968,5 +968,5 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
968 } 968 }
969 } 969 }
970 if ( mSyncKDE ) { 970 if ( mSyncManager->syncWithDesktop() ) {
971 fullDateRange = ( eventLSync->dtStart() == mLastCalendarSync ); 971 fullDateRange = ( eventLSync->dtStart() == mLastCalendarSync );
972 } 972 }
@@ -1028,5 +1028,5 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1028 inR->setIDStr( idS ); 1028 inR->setIDStr( idS );
1029 remote->addIncidence( inR ); 1029 remote->addIncidence( inR );
1030 if ( mSyncKDE ) 1030 if ( mSyncManager->syncWithDesktop() )
1031 inR->setPilotId( 2 ); 1031 inR->setPilotId( 2 );
1032 ++changedRemote; 1032 ++changedRemote;
@@ -1036,5 +1036,5 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1036 local->deleteIncidence( inL ); 1036 local->deleteIncidence( inL );
1037 inL = inR->clone(); 1037 inL = inR->clone();
1038 if ( mSyncKDE ) 1038 if ( mSyncManager->syncWithDesktop() )
1039 inL->setPilotId( pid ); 1039 inL->setPilotId( pid );
1040 inL->setIDStr( idS ); 1040 inL->setIDStr( idS );
@@ -1184,5 +1184,5 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1184 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1184 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1185 eventLSync->setReadOnly( true ); 1185 eventLSync->setReadOnly( true );
1186 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncKDE) // kde is abnormal... 1186 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1187 remote->addEvent( eventRSync ); 1187 remote->addEvent( eventRSync );
1188 else 1188 else
@@ -3746,8 +3746,6 @@ bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
3746{ 3746{
3747 // mSyncManager = manager; 3747 // mSyncManager = manager;
3748 mSyncKDE = false;
3749 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { 3748 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) {
3750 qDebug("SyncKDE request detected!"); 3749 qDebug("SyncKDE request detected!");
3751 mSyncKDE = true;
3752 } 3750 }
3753 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 3751 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
@@ -3757,5 +3755,4 @@ bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
3757bool CalendarView::syncExternal(KSyncManager* manager, QString resource) 3755bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
3758{ 3756{
3759 mSyncKDE = false;
3760 //mSyncManager = manager; 3757 //mSyncManager = manager;
3761 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 3758 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index acc20d6..437a51c 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -490,5 +490,4 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
490 490
491 private: 491 private:
492 bool mSyncKDE;
493 KSyncManager* mSyncManager; 492 KSyncManager* mSyncManager;
494 AlarmDialog * mAlarmDialog; 493 AlarmDialog * mAlarmDialog;
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index e09050e..17e6c75 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -188,4 +188,5 @@ void KSyncManager::slotSyncMenu( int action )
188 if ( action == 5000 ) 188 if ( action == 5000 )
189 return; 189 return;
190 mSyncWithDesktop = false;
190 if ( action == 0 ) { 191 if ( action == 0 ) {
191 192
@@ -252,4 +253,5 @@ void KSyncManager::slotSyncMenu( int action )
252 253
253 if ( action == 1000 ) { 254 if ( action == 1000 ) {
255 mIsKapiFile = false;
254#ifdef DESKTOP_VERSION 256#ifdef DESKTOP_VERSION
255 syncKDE(); 257 syncKDE();
@@ -883,9 +885,27 @@ void KSyncManager::confSync()
883void KSyncManager::syncKDE() 885void KSyncManager::syncKDE()
884{ 886{
887 mSyncWithDesktop = true;
885 emit save(); 888 emit save();
886 switch(mTargetApp) 889 switch(mTargetApp)
887 { 890 {
888 case (KAPI): 891 case (KAPI):
892 {
893#ifdef DESKTOP_VERSION
894 QString command = qApp->applicationDirPath () + "/kdeabdump";
895#else
896 QString command = "kdeabdump";
897#endif
898 if ( ! QFile::exists ( command ) )
899 command = "kdeabdump";
900 QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf";
901 system ( command.latin1());
902 if ( syncWithFile( fileName,true ) ) {
903 if ( mWriteBackFile ) {
904 command += " --read";
905 system ( command.latin1());
906 }
907 }
889 908
909 }
890 break; 910 break;
891 case (KOPI): 911 case (KOPI):
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 2af891b..6da0ee4 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -123,4 +123,5 @@ class KSyncManager : public QObject
123 void enableQuick( bool ask = true); 123 void enableQuick( bool ask = true);
124 124
125 bool syncWithDesktop () { return mSyncWithDesktop;}
125 QString getCurrentSyncDevice() { return mCurrentSyncDevice; } 126 QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
126 QString getCurrentSyncName() { return mCurrentSyncName; } 127 QString getCurrentSyncName() { return mCurrentSyncName; }
@@ -188,4 +189,5 @@ class KSyncManager : public QObject
188 QPopupMenu* mSyncMenu; 189 QPopupMenu* mSyncMenu;
189 QProgressBar* bar; 190 QProgressBar* bar;
191 bool mSyncWithDesktop;
190 192
191private slots: 193private slots: