-rw-r--r-- | kaddressbook/kabcore.cpp | 12 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 14 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 1 | ||||
-rw-r--r-- | libkdepim/kpimprefs.h | 18 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 100 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 20 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdoc.cpp | 6 |
8 files changed, 78 insertions, 95 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index b014cba..9041e45 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -2607,3 +2607,3 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo } else { - if ( ! KABPrefs::instance()->mWriteBackExistingOnly ) { + if ( ! syncManager->mWriteBackExistingOnly ) { inL.removeID(mCurrentSyncDevice ); @@ -2624,3 +2624,3 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo } else { - if ( ! KABPrefs::instance()->mWriteBackExistingOnly ) { + if ( ! syncManager->mWriteBackExistingOnly ) { ++addedAddresseeR; @@ -2660,3 +2660,3 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR ); - if ( KABPrefs::instance()->mShowSyncSummary ) { + if ( syncManager->mShowSyncSummary ) { KMessageBox::information(this, mes, i18n("KA/Pi Synchronization") ); @@ -2721,3 +2721,3 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) if ( syncOK ) { - if ( KABPrefs::instance()->mWriteBackFile ) + if ( syncManager->mWriteBackFile ) { @@ -2771,5 +2771,5 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource) qDebug("KABCore::syncExternal: why do we acces here KABPrefs and not somehow KSyncProfile? "); - syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, KABPrefs::instance()->mSyncAlgoPrefs ); + syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); if ( syncOK ) { - if ( KABPrefs::instance()->mWriteBackFile ) { + if ( syncManager->mWriteBackFile ) { abLocal.saveAB(); diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 38b55f7..1de2759 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -879,17 +879,3 @@ Event* CalendarView::getLastSyncEvent() } -// probaly useless -void CalendarView::setupExternSyncProfiles() -{ - Event* lse; - mExternLastSyncEvent.clear(); - int i; - for ( i = 0; i < KOPrefs::instance()->mExternSyncProfiles.count(); ++i ) { - lse = mCalendar->event( "last-syncEvent-"+ KOPrefs::instance()->mExternSyncProfiles[i] ); - if ( lse ) - mExternLastSyncEvent.append( lse ); - else - qDebug("Last Sync event not found for %s ", KOPrefs::instance()->mExternSyncProfiles[i].latin1()); - } -} // we check, if the to delete event has a id for a profile diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index a713c91..0f7e696 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -115,3 +115,2 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser Incidence *currentSelection(); - void setupExternSyncProfiles(); @@ -546,3 +545,2 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser Incidence *mMoveIncidence; - QPtrList<Event> mExternLastSyncEvent; KOTodoView *mTodoList; diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index ec69b11..9104347 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -992,3 +992,2 @@ void MainWindow::fillSyncMenu() } - mView->setupExternSyncProfiles(); } diff --git a/libkdepim/kpimprefs.h b/libkdepim/kpimprefs.h index 01c57a3..6f92919 100644 --- a/libkdepim/kpimprefs.h +++ b/libkdepim/kpimprefs.h @@ -58,19 +58,3 @@ class KPimPrefs : public KPrefs - // sync stuff - QString mLocalMachineName; - QStringList mExternSyncProfiles; - QStringList mSyncProfileNames; - bool mAskForPreferences; - bool mShowSyncSummary; - bool mShowSyncEvents; - bool mShowTodoInAgenda; - bool mWriteBackExistingOnly; - int mSyncAlgoPrefs; - int mRingSyncAlgoPrefs; - bool mWriteBackFile; - int mWriteBackInFuture; - QString mPhoneDevice; - QString mPhoneConnection; - QString mPhoneModel; - QString mLastSyncedLocalFile; // save! + diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 07e6761..c0cc840 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -54,3 +54,3 @@ KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) - : QObject(), mParent(parent), mImplementation(implementation), mTargetApp(ta), mPrefs(prefs), mSyncMenu(syncmenu) + : QObject(), mParent(parent), mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) { @@ -88,3 +88,3 @@ void KSyncManager::fillSyncMenu() QStringList prof = config.readListEntry("SyncProfileNames"); - mPrefs->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); + mLocalMachineName = config.readEntry("LocalMachineName","undefined"); if ( prof.count() < 3 ) { @@ -107,4 +107,4 @@ void KSyncManager::fillSyncMenu() } - mPrefs->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); - mPrefs->mSyncProfileNames = prof; + mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); + mSyncProfileNames = prof; unsigned int i; @@ -123,4 +123,2 @@ void KSyncManager::fillSyncMenu() } - //probaly useless - //mView->setupExternSyncProfiles(); } @@ -152,16 +150,16 @@ void KSyncManager::slotSyncMenu( int action ) mCurrentSyncProfile = action - 1000 ; - mCurrentSyncDevice = mPrefs->mSyncProfileNames[mCurrentSyncProfile] ; - mCurrentSyncName = mPrefs->mLocalMachineName ; + mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ; + mCurrentSyncName = mLocalMachineName ; KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); KSyncProfile* temp = new KSyncProfile (); - temp->setName(mPrefs->mSyncProfileNames[mCurrentSyncProfile]); + temp->setName(mSyncProfileNames[mCurrentSyncProfile]); temp->readConfig(&config); - mPrefs->mAskForPreferences = temp->getAskForPreferences(); - mPrefs->mSyncAlgoPrefs = temp->getSyncPrefs(); - mPrefs->mWriteBackFile = temp->getWriteBackFile(); - mPrefs->mWriteBackExistingOnly = temp->getWriteBackExisting(); - mPrefs->mWriteBackInFuture = 0; + mAskForPreferences = temp->getAskForPreferences(); + mSyncAlgoPrefs = temp->getSyncPrefs(); + mWriteBackFile = temp->getWriteBackFile(); + mWriteBackExistingOnly = temp->getWriteBackExisting(); + mWriteBackInFuture = 0; if ( temp->getWriteBackFuture() ) - mPrefs->mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); - mPrefs->mShowSyncSummary = temp->getShowSummaryAfterSync(); + mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); + mShowSyncSummary = temp->getShowSummaryAfterSync(); if ( action == 1000 ) { @@ -181,3 +179,3 @@ void KSyncManager::slotSyncMenu( int action ) if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); + mLastSyncedLocalFile = temp->getRemoteFileNameAB(); break; @@ -185,3 +183,3 @@ void KSyncManager::slotSyncMenu( int action ) if ( syncWithFile( temp->getRemoteFileName( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); + mLastSyncedLocalFile = temp->getRemoteFileName(); break; @@ -189,3 +187,3 @@ void KSyncManager::slotSyncMenu( int action ) if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); + mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); break; @@ -198,5 +196,5 @@ void KSyncManager::slotSyncMenu( int action ) if ( temp->getIsPhoneSync() ) { - mPrefs->mPhoneDevice = temp->getPhoneDevice( ) ; - mPrefs->mPhoneConnection = temp->getPhoneConnection( ); - mPrefs->mPhoneModel = temp->getPhoneModel( ); + mPhoneDevice = temp->getPhoneDevice( ) ; + mPhoneConnection = temp->getPhoneConnection( ); + mPhoneModel = temp->getPhoneModel( ); syncPhone(); @@ -214,3 +212,3 @@ void KSyncManager::syncLocalFile() - QString fn =mPrefs->mLastSyncedLocalFile; + QString fn =mLastSyncedLocalFile; QString ext; @@ -265,3 +263,3 @@ bool KSyncManager::syncWithFile( QString fn , bool quick ) } - if ( mPrefs->mAskForPreferences ) + if ( mAskForPreferences ) edit_sync_options(); @@ -269,3 +267,3 @@ bool KSyncManager::syncWithFile( QString fn , bool quick ) //qDebug("Now sycing ... "); - if ( ret = mImplementation->sync( this, fn, mPrefs->mSyncAlgoPrefs ) ) + if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) ) mParent->setCaption( i18n("Synchronization successful") ); @@ -274,3 +272,3 @@ bool KSyncManager::syncWithFile( QString fn , bool quick ) if ( ! quick ) - mPrefs->mLastSyncedLocalFile = fn; + mLastSyncedLocalFile = fn; mImplementation->sync_setModified(); @@ -282,3 +280,3 @@ void KSyncManager::quickSyncLocalFile() - if ( syncWithFile( mPrefs->mLastSyncedLocalFile, false ) ) { + if ( syncWithFile( mLastSyncedLocalFile, false ) ) { qDebug("quick syncLocalFile() successful "); @@ -302,6 +300,6 @@ void KSyncManager::multiSync( bool askforPrefs ) mCurrentSyncDevice = i18n("Multiple profiles") ; - mPrefs->mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs; + mSyncAlgoPrefs = mRingSyncAlgoPrefs; if ( askforPrefs ) { edit_sync_options(); - mPrefs->mRingSyncAlgoPrefs = mPrefs->mSyncAlgoPrefs; + mRingSyncAlgoPrefs = mSyncAlgoPrefs; } @@ -327,5 +325,5 @@ int KSyncManager::ringSync() KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); - QStringList syncProfileNames = mPrefs->mSyncProfileNames; + QStringList syncProfileNames = mSyncProfileNames; KSyncProfile* temp = new KSyncProfile (); - mPrefs->mAskForPreferences = false; + mAskForPreferences = false; for ( i = 0; i < syncProfileNames.count(); ++i ) { @@ -357,11 +355,11 @@ int KSyncManager::ringSync() ++syncedProfiles; - // mPrefs->mAskForPreferences = temp->getAskForPreferences(); - mPrefs->mWriteBackFile = temp->getWriteBackFile(); - mPrefs->mWriteBackExistingOnly = temp->getWriteBackExisting(); - mPrefs->mWriteBackInFuture = 0; + // mAskForPreferences = temp->getAskForPreferences(); + mWriteBackFile = temp->getWriteBackFile(); + mWriteBackExistingOnly = temp->getWriteBackExisting(); + mWriteBackInFuture = 0; if ( temp->getWriteBackFuture() ) - mPrefs->mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); - mPrefs->mShowSyncSummary = false; + mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); + mShowSyncSummary = false; mCurrentSyncDevice = syncProfileNames[i] ; - mCurrentSyncName = mPrefs->mLocalMachineName; + mCurrentSyncName = mLocalMachineName; if ( i == 0 ) { @@ -374,3 +372,3 @@ int KSyncManager::ringSync() if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); + mLastSyncedLocalFile = temp->getRemoteFileNameAB(); break; @@ -378,3 +376,3 @@ int KSyncManager::ringSync() if ( syncWithFile( temp->getRemoteFileName( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); + mLastSyncedLocalFile = temp->getRemoteFileName(); break; @@ -382,3 +380,3 @@ int KSyncManager::ringSync() if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); + mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); break; @@ -390,5 +388,5 @@ int KSyncManager::ringSync() if ( temp->getIsPhoneSync() ) { - mPrefs->mPhoneDevice = temp->getPhoneDevice( ) ; - mPrefs->mPhoneConnection = temp->getPhoneConnection( ); - mPrefs->mPhoneModel = temp->getPhoneModel( ); + mPhoneDevice = temp->getPhoneDevice( ) ; + mPhoneConnection = temp->getPhoneConnection( ); + mPhoneModel = temp->getPhoneModel( ); syncPhone(); @@ -493,3 +491,3 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask) // e->setReadOnly( true ); - if ( mPrefs->mWriteBackFile ) { + if ( mWriteBackFile ) { int fi; @@ -517,3 +515,3 @@ void KSyncManager::edit_sync_options() //mDialogManager->showSyncOptions(); - //mPrefs->mSyncAlgoPrefs + //mSyncAlgoPrefs QDialog dia( mParent, "dia", true ); @@ -535,3 +533,3 @@ void KSyncManager::edit_sync_options() connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); - switch ( mPrefs->mSyncAlgoPrefs ) { + switch ( mSyncAlgoPrefs ) { case 0: @@ -561,3 +559,3 @@ void KSyncManager::edit_sync_options() if ( dia.exec() ) { - mPrefs->mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; + mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; } @@ -605,4 +603,4 @@ void KSyncManager::confSync() sp->exec(); - mPrefs->mSyncProfileNames = sp->getSyncProfileNames(); - mPrefs->mLocalMachineName = sp->getLocalMachineName (); + mSyncProfileNames = sp->getSyncProfileNames(); + mLocalMachineName = sp->getLocalMachineName (); fillSyncMenu(); @@ -621,3 +619,3 @@ bool KSyncManager::syncExternalApplication(QString resource) - if ( mPrefs->mAskForPreferences ) + if ( mAskForPreferences ) edit_sync_options(); diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 9761107..6b10016 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h @@ -61,2 +61,21 @@ class KSyncManager : public QObject + // sync stuff + QString mLocalMachineName; + QStringList mExternSyncProfiles; + QStringList mSyncProfileNames; + bool mAskForPreferences; + bool mShowSyncSummary; + bool mShowSyncEvents; + bool mShowTodoInAgenda; + bool mWriteBackExistingOnly; + int mSyncAlgoPrefs; + int mRingSyncAlgoPrefs; + bool mWriteBackFile; + int mWriteBackInFuture; + QString mPhoneDevice; + QString mPhoneConnection; + QString mPhoneModel; + QString mLastSyncedLocalFile; // save! + + @@ -94,3 +113,2 @@ class KSyncManager : public QObject TargetApp mTargetApp; - KPimPrefs* mPrefs; QPopupMenu* mSyncMenu; diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp index 6c1a9c0..76a45f4 100644 --- a/pwmanager/pwmanager/pwmdoc.cpp +++ b/pwmanager/pwmanager/pwmdoc.cpp @@ -2962,3 +2962,3 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s } else { - if ( ! PWMPrefs::instance()->mWriteBackExistingOnly ) { + if ( ! manager->mWriteBackExistingOnly ) { ++addedPasswordsRemote; @@ -2997,3 +2997,3 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedPasswordsLocal, addedPasswordsRemote, changedLocal, changedRemote, deletedPasswordsLocal, deletedPasswordsRemote ); - if ( PWMPrefs::instance()->mShowSyncSummary ) { + if ( manager->mShowSyncSummary ) { KMessageBox::information(0, mes, i18n("PWM/Pi Synchronization") ); @@ -3141,3 +3141,3 @@ bool PwMDoc::sync(KSyncManager* manager, QString filename, int mode) if (err == e_success) { - if ( PWMPrefs::instance()->mWriteBackFile ) { + if ( manager->mWriteBackFile ) { qDebug("Saving remote PWManager file"); |