Browse Source

support deleting entries, always tell file that entry information was changed.

remove-cryptography-dependency
Herbert Poul 5 years ago
parent
commit
b9f373dfe0
  1. 4
      lib/src/kdbx_dao.dart
  2. 7
      lib/src/kdbx_object.dart

4
lib/src/kdbx_dao.dart

@ -51,6 +51,10 @@ extension KdbxDao on KdbxFile {
move(group, recycleBin); move(group, recycleBin);
} }
void deleteEntry(KdbxEntry entry) {
move(entry, recycleBin);
}
void move(KdbxObject kdbxObject, KdbxGroup toGroup) { void move(KdbxObject kdbxObject, KdbxGroup toGroup) {
assert(toGroup != null); assert(toGroup != null);
kdbxObject.times.locationChanged.setToNow(); kdbxObject.times.locationChanged.setToNow();

7
lib/src/kdbx_object.dart

@ -97,7 +97,7 @@ abstract class KdbxObject extends KdbxNode {
set isDirty(bool dirty) { set isDirty(bool dirty) {
if (dirty) { if (dirty) {
times.modifiedNow(); times.modifiedNow();
if (!isDirty && dirty) { if (/*!isDirty && */ dirty) {
file.dirtyObject(this); file.dirtyObject(this);
} }
} }
@ -112,7 +112,10 @@ abstract class KdbxObject extends KdbxNode {
return el; return el;
} }
void internalChangeParent(KdbxGroup parent) => _parent = parent; void internalChangeParent(KdbxGroup parent) {
_parent = parent;
isDirty = true;
}
} }
class KdbxUuid { class KdbxUuid {

Loading…
Cancel
Save