author | ulf69 <ulf69> | 2004-10-13 22:15:49 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-13 22:15:49 (UTC) |
commit | 7c2a228f94d8bcb783ce6f3527cb2daa9221217b (patch) (side-by-side diff) | |
tree | 2c009f3dfd2d9897a53d0e02a067f3fff36d970b /pwmanager | |
parent | 737183a5abd7d7b02048e8a939bafd0a8e803918 (diff) | |
download | kdepimpi-7c2a228f94d8bcb783ce6f3527cb2daa9221217b.zip kdepimpi-7c2a228f94d8bcb783ce6f3527cb2daa9221217b.tar.gz kdepimpi-7c2a228f94d8bcb783ce6f3527cb2daa9221217b.tar.bz2 |
changes to make sync working
-rw-r--r-- | pwmanager/pwmanager/pwmdoc.cpp | 22 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdoc.h | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp index ab3238a..3f2f042 100644 --- a/pwmanager/pwmanager/pwmdoc.cpp +++ b/pwmanager/pwmanager/pwmdoc.cpp @@ -2796,14 +2796,14 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s int addedPasswordsRemote = 0; int deletedPasswordsRemote = 0; int deletedPasswordsLocal = 0; int changedLocal = 0; int changedRemote = 0; - PwMSyncItem syncItemLocal; - PwMSyncItem syncItemRemote; + PwMSyncItem* syncItemLocal; + PwMSyncItem* syncItemRemote; QString mCurrentSyncName = manager->getCurrentSyncName(); QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); bool fullDateRange = false; int take; @@ -2825,13 +2825,13 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s qDebug("PwMDoc::syncronize : newly created local sync data could not be found"); return e_syncError; } } syncItemLocal = syncLocal->getSyncDataEntry(index); - qDebug("Last Sync %s ", syncItemLocal.lastSyncDate.toString().latin1()); + qDebug("Last Sync %s ", syncItemLocal->lastSyncDate.toString().latin1()); //Step 2. Find syncinfo in remote file and create if not existent. found = syncRemote->findSyncData(mCurrentSyncName, &index); if (found == false) { qDebug("FULLDATE 1"); @@ -2846,27 +2846,27 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s return e_syncError; } } syncItemRemote = syncRemote->getSyncDataEntry(index); //and remove the found entry here. We will reenter it later again. - syncRemote->delSyncDataEntry(index, true); + //US syncRemote->delSyncDataEntry(index, true); - if ( syncItemLocal.lastSyncDate == mLastSync ) { + if ( syncItemLocal->lastSyncDate == mLastSync ) { qDebug("FULLDATE 2"); fullDateRange = true; } if ( ! fullDateRange ) { - if ( syncItemLocal.lastSyncDate != syncItemRemote->lastSyncDate ) { + if ( syncItemLocal->lastSyncDate != syncItemRemote->lastSyncDate ) { // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() ); //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec()); fullDateRange = true; - qDebug("FULLDATE 3 %s %s", syncItemLocal.lastSyncDate.toString().latin1() , syncItemRemote.lastSyncDate.toString().latin1() ); + qDebug("FULLDATE 3 %s %s", syncItemLocal->lastSyncDate.toString().latin1() , syncItemRemote->lastSyncDate.toString().latin1() ); } } // fullDateRange = true; // debug only! if ( fullDateRange ) mLastSync = QDateTime::currentDateTime().addDays( -100*365); else @@ -2994,20 +2994,20 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s mLastSync = QDateTime::currentDateTime().addSecs( 1 ); // get rid of micro seconds QTime t = mLastSync.time(); mLastSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); - syncItemLocal.lastSyncDate = mLastSync; - syncItemRemote.lastSyncDate = mLastSync; + syncItemLocal->lastSyncDate = mLastSync; + syncItemRemote->lastSyncDate = mLastSync; // addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; // addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); - syncRemote->addSyncDataEntry( syncItemRemote, false ); - syncLocal->addSyncDataEntry( syncItemLocal, false ); + //US syncRemote->addSyncDataEntry( syncItemRemote, false ); + //US 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 ( manager->mShowSyncSummary ) { KMessageBox::information(0, mes, i18n("PWM/Pi Synchronization") ); } qDebug( mes ); diff --git a/pwmanager/pwmanager/pwmdoc.h b/pwmanager/pwmanager/pwmdoc.h index ddab7f3..2e9547e 100644 --- a/pwmanager/pwmanager/pwmdoc.h +++ b/pwmanager/pwmanager/pwmdoc.h @@ -788,14 +788,14 @@ protected: bool findSyncData(const QString &syncname, unsigned int *index); /** add new syncdataentry */ PwMerror addSyncDataEntry(PwMSyncItem *d, bool dontFlagDirty = false); /** returns a pointer to the syncdata */ - PwMSyncItem getSyncDataEntry(unsigned int index) - { return *(dti.syncDta[index]); } + PwMSyncItem* getSyncDataEntry(unsigned int index) + { return &(dti.syncDta[index]); } /** delete entry */ bool delSyncDataEntry(unsigned int index, bool dontFlagDirty = false); PwMDataItem* findEntryByID(const QString &uid, unsigned int *category, unsigned int *index); |