summaryrefslogtreecommitdiffabout
path: root/pwmanager
authorulf69 <ulf69>2004-10-08 00:24:58 (UTC)
committer ulf69 <ulf69>2004-10-08 00:24:58 (UTC)
commit309df8e8df3a17602f948025b7951b21ec5c3fed (patch) (unidiff)
treef1b504be724510bd8d49b106cd1b98e09187c547 /pwmanager
parent91e43b55a0ddf6a6f39f4ed3ae828ddad6ec89a5 (diff)
downloadkdepimpi-309df8e8df3a17602f948025b7951b21ec5c3fed.zip
kdepimpi-309df8e8df3a17602f948025b7951b21ec5c3fed.tar.gz
kdepimpi-309df8e8df3a17602f948025b7951b21ec5c3fed.tar.bz2
*** empty log message ***
Diffstat (limited to 'pwmanager') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp36
-rw-r--r--pwmanager/pwmanager/pwmdoc.h38
-rw-r--r--pwmanager/pwmanager/serializer.cpp2
3 files changed, 58 insertions, 18 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;
diff --git a/pwmanager/pwmanager/pwmdoc.h b/pwmanager/pwmanager/pwmdoc.h
index 91277f6..ddab7f3 100644
--- a/pwmanager/pwmanager/pwmdoc.h
+++ b/pwmanager/pwmanager/pwmdoc.h
@@ -118,5 +118,5 @@ struct PwMMetaData
118 118
119 //US ENH: enhancements of the filestructure 119 //US ENH: enhancements of the filestructure
120 /* each entry gets a unique id assigned */ 120 /* each entry gets a unique id assigned */
121 QString uniqueid; 121 string uniqueid;
122 122
@@ -131,2 +131,13 @@ struct PwMMetaData
131 } 131 }
132
133 PwMMetaData& operator = (const PwMMetaData& x)
134 {
135 create = x.create;
136 expire = x.expire;
137 update = x.update;
138 updateInt = x.updateInt;
139 uniqueid = x.uniqueid;
140 return *this;
141 }
142
132 inline bool isValid() const 143 inline bool isValid() const
@@ -208,2 +219,19 @@ struct PwMDataItem
208 } 219 }
220
221 PwMDataItem& operator = (const PwMDataItem& x)
222 {
223 qDebug("oper=%s", x.desc.c_str());
224 desc = x.desc;
225 name = x.name;
226 pw = x.pw;
227 comment = x.comment;
228 url = x.url;
229 launcher = x.launcher;
230 lockStat = x.lockStat;
231 listViewPos = x.listViewPos;
232 binary = x.binary;
233 meta = x.meta;
234 rev = x.rev;
235 return *this;
236 }
209 237
@@ -765,4 +793,4 @@ protected:
765 /** returns a pointer to the syncdata */ 793 /** returns a pointer to the syncdata */
766 PwMSyncItem* getSyncDataEntry(unsigned int index) 794 PwMSyncItem getSyncDataEntry(unsigned int index)
767 { return &(dti.syncDta[index]); } 795 { return *(dti.syncDta[index]); }
768 796
diff --git a/pwmanager/pwmanager/serializer.cpp b/pwmanager/pwmanager/serializer.cpp
index f615082..74b3354 100644
--- a/pwmanager/pwmanager/serializer.cpp
+++ b/pwmanager/pwmanager/serializer.cpp
@@ -648,3 +648,3 @@ bool Serializer::writeMeta(QDomElement *e,
648 tag = domDoc->createElement(META_UNIQUEID); 648 tag = domDoc->createElement(META_UNIQUEID);
649 text = domDoc->createTextNode(escapeEntryData(dta.uniqueid)); 649 text = domDoc->createTextNode(escapeEntryData(dta.uniqueid.c_str()));
650 tag.appendChild(text); 650 tag.appendChild(text);