summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-06 20:51:01 (UTC)
committer zautrix <zautrix>2004-10-06 20:51:01 (UTC)
commit0afcfa29ace7bc5e42a11fae44301e1e8230a376 (patch) (side-by-side diff)
treeb54f85b19ace24219be1b845469444089cacc94f
parented4675de07d947f55d2672c721599e3a0af1e24b (diff)
downloadkdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.zip
kdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.tar.gz
kdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.tar.bz2
some prefs cleanups
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp12
-rw-r--r--korganizer/calendarview.cpp14
-rw-r--r--korganizer/calendarview.h2
-rw-r--r--korganizer/mainwindow.cpp1
-rw-r--r--libkdepim/kpimprefs.h18
-rw-r--r--libkdepim/ksyncmanager.cpp100
-rw-r--r--libkdepim/ksyncmanager.h20
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp6
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
@@ -2604,9 +2604,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
// pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
local->removeAddressee( inL );
++deletedAddresseeL;
} else {
- if ( ! KABPrefs::instance()->mWriteBackExistingOnly ) {
+ if ( ! syncManager->mWriteBackExistingOnly ) {
inL.removeID(mCurrentSyncDevice );
++addedAddresseeR;
inL.setRevision( modifiedCalendar );
local->insertAddressee( inL, false );
@@ -2621,9 +2621,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
// pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
local->removeAddressee( inL );
++deletedAddresseeL;
} else {
- if ( ! KABPrefs::instance()->mWriteBackExistingOnly ) {
+ if ( ! syncManager->mWriteBackExistingOnly ) {
++addedAddresseeR;
inL.setRevision( modifiedCalendar );
local->insertAddressee( inL, false );
inR = inL;
@@ -2657,9 +2657,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
remote->insertAddressee( addresseeRSync, false );
local->insertAddressee( addresseeLSync, false );
QString mes;
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") );
}
qDebug( mes );
return syncOK;
@@ -2718,9 +2718,9 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
// qDebug("Name %s ", (*it).familyName().latin1());
//}
syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode );
if ( syncOK ) {
- if ( KABPrefs::instance()->mWriteBackFile )
+ if ( syncManager->mWriteBackFile )
{
if ( external )
abLocal.removeSyncAddressees( !isXML);
qDebug("Saving remote AB ");
@@ -2768,11 +2768,11 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
mGlobalSyncMode = SYNC_MODE_EXTERNAL;
abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice );
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();
abLocal.postExternSync( mAddressBook,mCurrentSyncDevice );
}
}
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 38b55f7..1de2759 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -876,23 +876,9 @@ Event* CalendarView::getLastSyncEvent()
return lse;
}
-// 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
// if yes, we set this id in the profile to delete
void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete )
{
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index a713c91..0f7e696 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -112,9 +112,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void addView(KOrg::BaseView *);
void showView(KOrg::BaseView *);
KOEventViewerDialog* getEventViewerDialog();
Incidence *currentSelection();
- void setupExternSyncProfiles();
signals:
/** This todo has been modified */
void todoModified(Todo *, int);
@@ -543,9 +542,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
QDate mSaveSingleDate;
Incidence *mSelectedIncidence;
Incidence *mMoveIncidence;
- QPtrList<Event> mExternLastSyncEvent;
KOTodoView *mTodoList;
KOEventEditor * mEventEditor;
KOTodoEditor * mTodoEditor;
KOEventViewerDialog * mEventViewerDialog;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index ec69b11..9104347 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -989,9 +989,8 @@ void MainWindow::fillSyncMenu()
QDir app_dir;
if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) {
syncMenu->setItemEnabled( false , 1000 );
}
- mView->setupExternSyncProfiles();
}
int MainWindow::ringSync()
{
diff --git a/libkdepim/kpimprefs.h b/libkdepim/kpimprefs.h
index 01c57a3..6f92919 100644
--- a/libkdepim/kpimprefs.h
+++ b/libkdepim/kpimprefs.h
@@ -55,25 +55,9 @@ class KPimPrefs : public KPrefs
public:
QStringList mCustomCategories;
- // 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!
+
protected:
virtual void setCategoryDefaults();
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 07e6761..c0cc840 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -51,9 +51,9 @@
#include <kconfig.h>
#include <kfiledialog.h>
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 );
bar->setCaption ("");
@@ -85,9 +85,9 @@ void KSyncManager::fillSyncMenu()
KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
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();
prof << i18n("Sharp_DTM");
prof << i18n("Local_file");
@@ -104,10 +104,10 @@ void KSyncManager::fillSyncMenu()
config.writeEntry("ExternSyncProfiles","Sharp_DTM");
config.sync();
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 ) {
mSyncMenu->insertItem( prof[i], 1000+i );
if ( i == 2 )
@@ -120,10 +120,8 @@ void KSyncManager::fillSyncMenu()
}
else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) {
mSyncMenu->setItemEnabled( 1000, false );
}
- //probaly useless
- //mView->setupExternSyncProfiles();
}
void KSyncManager::slotSyncMenu( int action )
{
@@ -149,22 +147,22 @@ void KSyncManager::slotSyncMenu( int action )
setBlockSave(true);
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();
} else if ( action == 1001 ) {
@@ -178,28 +176,28 @@ void KSyncManager::slotSyncMenu( int action )
switch(mTargetApp)
{
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:
qDebug("KSyncManager::slotSyncMenu: invalid apptype selected");
break;
}
} 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
syncRemote( temp );
@@ -211,9 +209,9 @@ void KSyncManager::slotSyncMenu( int action )
void KSyncManager::syncLocalFile()
{
- QString fn =mPrefs->mLastSyncedLocalFile;
+ QString fn =mLastSyncedLocalFile;
QString ext;
switch(mTargetApp)
{
@@ -262,26 +260,26 @@ bool KSyncManager::syncWithFile( QString fn , bool quick )
0, 1 );
if ( result )
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();
}
return ret;
}
void KSyncManager::quickSyncLocalFile()
{
- if ( syncWithFile( mPrefs->mLastSyncedLocalFile, false ) ) {
+ if ( syncWithFile( mLastSyncedLocalFile, false ) ) {
qDebug("quick syncLocalFile() successful ");
}
}
@@ -299,12 +297,12 @@ void KSyncManager::multiSync( bool askforPrefs )
mParent->setCaption(i18n("Aborted! Nothing synced!"));
return;
}
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.") );
qApp->processEvents();
int num = ringSync() ;
@@ -324,11 +322,11 @@ int KSyncManager::ringSync()
int syncedProfiles = 0;
unsigned int i;
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;
temp->setName(syncProfileNames[mCurrentSyncProfile]);
temp->readConfig(&config);
@@ -354,44 +352,44 @@ int KSyncManager::ringSync()
if ( includeInRingSync && ( i < 1 || i > 2 )) {
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();
} else {
if ( temp->getIsLocalFileSync() ) {
switch(mTargetApp)
{
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:
qDebug("KSyncManager::slotSyncMenu: invalid apptype selected");
break;
}
} 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
syncRemote( temp, false );
@@ -490,9 +488,9 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask)
// Event* e = mView->getLastSyncEvent();
// e->setReadOnly( false );
// e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]);
// e->setReadOnly( true );
- if ( mPrefs->mWriteBackFile ) {
+ if ( mWriteBackFile ) {
int fi;
if ( (fi = postCommand.find("$PWD$")) > 0 ) {
QString pwd = getPassword();
postCommand = postCommand.left( fi )+ pwd + postCommand.mid( fi+5 );
@@ -514,9 +512,9 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask)
void KSyncManager::edit_sync_options()
{
//mDialogManager->showSyncOptions();
- //mPrefs->mSyncAlgoPrefs
+ //mSyncAlgoPrefs
QDialog dia( mParent, "dia", true );
dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice );
QButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia);
QVBoxLayout lay ( &dia );
@@ -532,9 +530,9 @@ void KSyncManager::edit_sync_options()
//QRadioButton both( i18n("Take both on conflict"), &gr );
QPushButton pb ( "OK", &dia);
lay.addWidget( &pb );
connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) );
- switch ( mPrefs->mSyncAlgoPrefs ) {
+ switch ( mSyncAlgoPrefs ) {
case 0:
loc.setChecked( true);
break;
case 1:
@@ -558,9 +556,9 @@ void KSyncManager::edit_sync_options()
default:
break;
}
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 ;
}
}
@@ -602,10 +600,10 @@ void KSyncManager::confSync()
#else
sp->show();
#endif
sp->exec();
- mPrefs->mSyncProfileNames = sp->getSyncProfileNames();
- mPrefs->mLocalMachineName = sp->getLocalMachineName ();
+ mSyncProfileNames = sp->getSyncProfileNames();
+ mLocalMachineName = sp->getLocalMachineName ();
fillSyncMenu();
}
void KSyncManager::syncSharp()
@@ -618,9 +616,9 @@ bool KSyncManager::syncExternalApplication(QString resource)
{
if ( mImplementation->sync_isModified() )
mImplementation->sync_save();
- if ( mPrefs->mAskForPreferences )
+ if ( mAskForPreferences )
edit_sync_options();
qDebug("sync %s", resource.latin1());
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 9761107..6b10016 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -58,8 +58,27 @@ class KSyncManager : public QObject
void showProgressBar(int percentage, QString caption = QString::null, int total=100);
void hideProgressBar();
bool isProgressBarCanceled();
+ // 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!
+
+
public slots:
void slotSyncMenu( int );
@@ -91,9 +110,8 @@ class KSyncManager : public QObject
QWidget* mParent;
KSyncInterface* mImplementation;
TargetApp mTargetApp;
- KPimPrefs* mPrefs;
QPopupMenu* mSyncMenu;
QProgressBar* bar;
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
@@ -2959,9 +2959,9 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
syncLocal->delEntry(catLocal, indexLocal, true);
//USsyncLocal->removeAddressee( inLocal );
++deletedPasswordsLocal;
} else {
- if ( ! PWMPrefs::instance()->mWriteBackExistingOnly ) {
+ if ( ! manager->mWriteBackExistingOnly ) {
++addedPasswordsRemote;
inLocal->meta.update = modifiedSync;
//USsyncLocal->insertAddressee( inLocal, false );
(*inRemote) = (*inLocal);
@@ -2994,9 +2994,9 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
syncRemote->addSyncDataEntry( syncItemRemote, false );
syncLocal->addSyncDataEntry( syncItemLocal, false );
QString mes;
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") );
}
qDebug( mes );
return e_success;
@@ -3138,9 +3138,9 @@ bool PwMDoc::sync(KSyncManager* manager, QString filename, int mode)
err = syncronize(manager, this, pSyncTarget, mode );
if (err == e_success) {
- if ( PWMPrefs::instance()->mWriteBackFile ) {
+ if ( manager->mWriteBackFile ) {
qDebug("Saving remote PWManager file");
err = pSyncTarget->saveDoc(conf()->confGlobCompression());
if (err != e_success) {
qDebug("PwmDoc::sync: Sync failed. Error %i while storing file %s",err, filename.latin1());