summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/pwmdoc.cpp
Unidiff
Diffstat (limited to 'pwmanager/pwmanager/pwmdoc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp
index 76a45f4..ab3238a 100644
--- a/pwmanager/pwmanager/pwmdoc.cpp
+++ b/pwmanager/pwmanager/pwmdoc.cpp
@@ -2801,4 +2801,4 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
2801 2801
2802 PwMSyncItem* syncItemLocal; 2802 PwMSyncItem syncItemLocal;
2803 PwMSyncItem* syncItemRemote; 2803 PwMSyncItem syncItemRemote;
2804 2804
@@ -2830,3 +2830,3 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
2830 syncItemLocal = syncLocal->getSyncDataEntry(index); 2830 syncItemLocal = syncLocal->getSyncDataEntry(index);
2831 qDebug("Last Sync %s ", syncItemLocal->lastSyncDate.toString().latin1()); 2831 qDebug("Last Sync %s ", syncItemLocal.lastSyncDate.toString().latin1());
2832 2832
@@ -2854,3 +2854,3 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
2854 2854
2855 if ( syncItemLocal->lastSyncDate == mLastSync ) { 2855 if ( syncItemLocal.lastSyncDate == mLastSync ) {
2856 qDebug("FULLDATE 2"); 2856 qDebug("FULLDATE 2");
@@ -2860,3 +2860,3 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
2860 if ( ! fullDateRange ) { 2860 if ( ! fullDateRange ) {
2861 if ( syncItemLocal->lastSyncDate != syncItemRemote->lastSyncDate ) { 2861 if ( syncItemLocal.lastSyncDate != syncItemRemote->lastSyncDate ) {
2862 2862
@@ -2865,3 +2865,3 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
2865 fullDateRange = true; 2865 fullDateRange = true;
2866 qDebug("FULLDATE 3 %s %s", syncItemLocal->lastSyncDate.toString().latin1() , syncItemRemote->lastSyncDate.toString().latin1() ); 2866 qDebug("FULLDATE 3 %s %s", syncItemLocal.lastSyncDate.toString().latin1() , syncItemRemote.lastSyncDate.toString().latin1() );
2867 } 2867 }
@@ -2922,5 +2922,8 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
2922 inRemote->meta.update = modifiedSync; 2922 inRemote->meta.update = modifiedSync;
2923
2924 //first check if we have a matching category in the local file
2925 const string* remotecat = syncRemote->getCategory(catRemote);
2923 //US syncRemote->insertAddressee( inRemote, false ); 2926 //US syncRemote->insertAddressee( inRemote, false );
2924 //US syncLocal->insertAddressee( inRemote, false ); 2927 //US syncLocal->insertAddressee( inRemote, false );
2925 syncLocal->addEntry("newcategory", inRemote, true, false); 2928 syncLocal->addEntry(remotecat->c_str(), inRemote, true, false);
2926 2929
@@ -2955,2 +2958,4 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
2955 inRemote = syncRemote->findEntryByID( uid, &catRemote, &indexRemote ); 2958 inRemote = syncRemote->findEntryByID( uid, &catRemote, &indexRemote );
2959 PWM_ASSERT(inLocal);
2960
2956 if ( inRemote == 0 ) { 2961 if ( inRemote == 0 ) {
@@ -2965,6 +2970,13 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
2965 inLocal->meta.update = modifiedSync; 2970 inLocal->meta.update = modifiedSync;
2971
2972 //first check if we have a matching category in the remote file
2973 const string* localcat = syncLocal->getCategory(catLocal);
2974
2966 //USsyncLocal->insertAddressee( inLocal, false ); 2975 //USsyncLocal->insertAddressee( inLocal, false );
2967 (*inRemote) = (*inLocal); 2976 PwMDataItem newEntry;
2977 newEntry = *inLocal;
2978 inRemote = &newEntry;
2979
2968 //USsyncRemote->insertAddressee( inRemote, false ); 2980 //USsyncRemote->insertAddressee( inRemote, false );
2969 syncRemote->addEntry("newcategory", inRemote, true, false); 2981 syncRemote->addEntry(localcat->c_str(), inRemote, true, false);
2970 2982
@@ -2987,4 +2999,4 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
2987 2999
2988 syncItemLocal->lastSyncDate = mLastSync; 3000 syncItemLocal.lastSyncDate = mLastSync;
2989 syncItemRemote->lastSyncDate = mLastSync; 3001 syncItemRemote.lastSyncDate = mLastSync;
2990 3002
@@ -3284,3 +3296,3 @@ QStringList PwMDoc::getIDEntryList()
3284 while (entrI != entrEnd) { 3296 while (entrI != entrEnd) {
3285 results.append( (*entrI).meta.uniqueid ); 3297 results.append( (*entrI).meta.uniqueid.c_str() );
3286 ++entrI; 3298 ++entrI;