From f8dd437160acec2959c462dd43d87f2a0920c0b9 Mon Sep 17 00:00:00 2001 From: ulf69 Date: Fri, 29 Oct 2004 01:27:31 +0000 Subject: enabling/disabling syncing of launcher --- diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp index fd17ce5..9043acc 100644 --- a/pwmanager/pwmanager/pwmdoc.cpp +++ b/pwmanager/pwmanager/pwmdoc.cpp @@ -3020,6 +3020,8 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s QString mCurrentSyncName = manager->getCurrentSyncName(); QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); + bool mSyncLauncher = true; + bool fullDateRange = false; int take; // local->resetTempSyncStat(); @@ -3120,14 +3122,10 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s if ( take == 3 ) return e_syncError; if ( take == 1 ) {// take local - int oldlistpos = inRemote->listViewPos; - (*inRemote) = (*inLocal); - inRemote->listViewPos = oldlistpos; + inRemote->syncItem(*inLocal, mSyncLauncher); ++changedRemote; } else { // take == 2 take remote - int oldlistpos = inLocal->listViewPos; - (*inLocal) = (*inRemote); - inLocal->listViewPos = oldlistpos; + inLocal->syncItem(*inRemote, mSyncLauncher); ++changedLocal; } } diff --git a/pwmanager/pwmanager/pwmdoc.h b/pwmanager/pwmanager/pwmdoc.h index e419c24..09923ab 100644 --- a/pwmanager/pwmanager/pwmdoc.h +++ b/pwmanager/pwmanager/pwmdoc.h @@ -224,6 +224,26 @@ struct PwMDataItem //all other field will not be checked. return true; } + + //US ENH: this sync method actually copies all values from the parameter like the =operator + //does with two exceptions: listViewPos will not be changed, and the launcher only if required. + bool PwMDataItem::syncItem(const PwMDataItem &a, bool syncLauncher=true ) + { + desc = a.desc; + name = a.name; + pw = a.pw; + comment = a.comment; + url = a.url; + if (syncLauncher == true) + launcher = a.launcher; + meta = a.meta; + binary = a.binary; + lockStat = a.lockStat; + rev = a.rev; + + return true; + } + }; struct PwMCategoryItem -- cgit v0.9.0.2