-rw-r--r-- | libkdepim/ksyncmanager.cpp | 100 |
1 files changed, 49 insertions, 51 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 07e6761..c0cc840 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -53,5 +53,5 @@ 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) { bar = new QProgressBar ( 1, 0 ); @@ -87,5 +87,5 @@ void KSyncManager::fillSyncMenu() config.setGroup("General"); QStringList prof = config.readListEntry("SyncProfileNames"); - mPrefs->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); + mLocalMachineName = config.readEntry("LocalMachineName","undefined"); if ( prof.count() < 3 ) { prof.clear(); @@ -106,6 +106,6 @@ void KSyncManager::fillSyncMenu() delete temp; } - mPrefs->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); - mPrefs->mSyncProfileNames = prof; + mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); + mSyncProfileNames = prof; unsigned int i; for ( i = 0; i < prof.count(); ++i ) { @@ -122,6 +122,4 @@ void KSyncManager::fillSyncMenu() mSyncMenu->setItemEnabled( 1000, false ); } - //probaly useless - //mView->setupExternSyncProfiles(); } @@ -151,18 +149,18 @@ 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 ) { syncSharp(); @@ -180,13 +178,13 @@ void KSyncManager::slotSyncMenu( int action ) case (KAPI): if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); + mLastSyncedLocalFile = temp->getRemoteFileNameAB(); break; case (KOPI): if ( syncWithFile( temp->getRemoteFileName( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); + mLastSyncedLocalFile = temp->getRemoteFileName(); break; case (PWMPI): if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); + mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); break; default: @@ -197,7 +195,7 @@ void KSyncManager::slotSyncMenu( int action ) } else { 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(); } else @@ -213,5 +211,5 @@ void KSyncManager::syncLocalFile() { - QString fn =mPrefs->mLastSyncedLocalFile; + QString fn =mLastSyncedLocalFile; QString ext; @@ -264,14 +262,14 @@ bool KSyncManager::syncWithFile( QString fn , bool quick ) return false; } - if ( mPrefs->mAskForPreferences ) + if ( mAskForPreferences ) edit_sync_options(); if ( result == 0 ) { //qDebug("Now sycing ... "); - if ( ret = mImplementation->sync( this, fn, mPrefs->mSyncAlgoPrefs ) ) + if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) ) mParent->setCaption( i18n("Synchronization successful") ); else mParent->setCaption( i18n("Sync cancelled or failed. Nothing synced.") ); if ( ! quick ) - mPrefs->mLastSyncedLocalFile = fn; + mLastSyncedLocalFile = fn; mImplementation->sync_setModified(); } @@ -281,5 +279,5 @@ void KSyncManager::quickSyncLocalFile() { - if ( syncWithFile( mPrefs->mLastSyncedLocalFile, false ) ) { + if ( syncWithFile( mLastSyncedLocalFile, false ) ) { qDebug("quick syncLocalFile() successful "); @@ -301,8 +299,8 @@ 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; } mParent->setCaption(i18n("Multiple sync started.") ); @@ -326,7 +324,7 @@ int KSyncManager::ringSync() QTime timer; 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 ) { mCurrentSyncProfile = i; @@ -356,13 +354,13 @@ int KSyncManager::ringSync() mParent->setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); ++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 ) { syncSharp(); @@ -373,13 +371,13 @@ int KSyncManager::ringSync() case (KAPI): if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); + mLastSyncedLocalFile = temp->getRemoteFileNameAB(); break; case (KOPI): if ( syncWithFile( temp->getRemoteFileName( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); + mLastSyncedLocalFile = temp->getRemoteFileName(); break; case (PWMPI): if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) - mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); + mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); break; default: @@ -389,7 +387,7 @@ int KSyncManager::ringSync() } else { 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(); } else @@ -492,5 +490,5 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask) // e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); // e->setReadOnly( true ); - if ( mPrefs->mWriteBackFile ) { + if ( mWriteBackFile ) { int fi; if ( (fi = postCommand.find("$PWD$")) > 0 ) { @@ -516,5 +514,5 @@ void KSyncManager::edit_sync_options() { //mDialogManager->showSyncOptions(); - //mPrefs->mSyncAlgoPrefs + //mSyncAlgoPrefs QDialog dia( mParent, "dia", true ); dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice ); @@ -534,5 +532,5 @@ void KSyncManager::edit_sync_options() lay.addWidget( &pb ); connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); - switch ( mPrefs->mSyncAlgoPrefs ) { + switch ( mSyncAlgoPrefs ) { case 0: loc.setChecked( true); @@ -560,5 +558,5 @@ 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 ; } @@ -604,6 +602,6 @@ void KSyncManager::confSync() #endif sp->exec(); - mPrefs->mSyncProfileNames = sp->getSyncProfileNames(); - mPrefs->mLocalMachineName = sp->getLocalMachineName (); + mSyncProfileNames = sp->getSyncProfileNames(); + mLocalMachineName = sp->getLocalMachineName (); fillSyncMenu(); } @@ -620,5 +618,5 @@ bool KSyncManager::syncExternalApplication(QString resource) mImplementation->sync_save(); - if ( mPrefs->mAskForPreferences ) + if ( mAskForPreferences ) edit_sync_options(); |