summaryrefslogtreecommitdiffabout
path: root/pwmanager
authorulf69 <ulf69>2004-10-29 17:31:58 (UTC)
committer ulf69 <ulf69>2004-10-29 17:31:58 (UTC)
commitb55890913f4c81bd2fc3719cf7c97e8ab1f47077 (patch) (side-by-side diff)
tree95da19ca855001977e046ddd761d8b9f6cfd66c9 /pwmanager
parenta507e84cbf0afb76570ca1d82bee24bc68faa513 (diff)
downloadkdepimpi-b55890913f4c81bd2fc3719cf7c97e8ab1f47077.zip
kdepimpi-b55890913f4c81bd2fc3719cf7c97e8ab1f47077.tar.gz
kdepimpi-b55890913f4c81bd2fc3719cf7c97e8ab1f47077.tar.bz2
implemented removeSyncProfile
Diffstat (limited to 'pwmanager') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp22
-rw-r--r--pwmanager/pwmanager/pwmdoc.h4
2 files changed, 25 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp
index ddbf4f2..17cb74a 100644
--- a/pwmanager/pwmanager/pwmdoc.cpp
+++ b/pwmanager/pwmanager/pwmdoc.cpp
@@ -3309,7 +3309,27 @@ int PwMDoc::takePwMDataItem( PwMDataItem* local, PwMDataItem* remote, QDateTime
void PwMDoc::removeSyncInfo( QString syncProfile)
{
- qDebug("PwMDoc::not implemented: removeSyncInfo for profile %s ", syncProfile.latin1());
+ bool res, found;
+ unsigned int count, i;
+ if ( syncProfile.isEmpty() ) {
+ count = numSyncDataEntries();
+ for (i = count; count > 0; count-- ) {
+ res = delSyncDataEntry(i-1, false);
+ if (res == false) {
+ qDebug("PwMDoc::removeSyncInfo: could not remove syncprofile");
+ }
+ }
+ } else {
+ found = findSyncData(syncProfile, &count);
+ if (found == true)
+ {
+ res = delSyncDataEntry(count, false);
+ if (res == false) {
+ qDebug("PwMDoc::removeSyncInfo: could not remove %s", syncProfile.latin1());
+
+ }
+ }
+ }
}
diff --git a/pwmanager/pwmanager/pwmdoc.h b/pwmanager/pwmanager/pwmdoc.h
index ef81dfc..138dd3d 100644
--- a/pwmanager/pwmanager/pwmdoc.h
+++ b/pwmanager/pwmanager/pwmdoc.h
@@ -814,6 +814,10 @@ protected:
/** delete entry */
bool delSyncDataEntry(unsigned int index, bool dontFlagDirty = false);
+ /** returns number of categories */
+ unsigned int numSyncDataEntries()
+ { return dti.syncDta.size(); }
+
PwMDataItem* findEntryByID(const QString &uid, unsigned int *category, unsigned int *index);
QStringList getIDEntryList();