Browse Source

fix writing of string values, also do not trigger dirty event, if entry is already dirty.

remove-cryptography-dependency
Herbert Poul 5 years ago
parent
commit
b17e2373f2
  1. 3
      lib/src/kdbx_entry.dart
  2. 4
      lib/src/kdbx_object.dart

3
lib/src/kdbx_entry.dart

@ -84,7 +84,8 @@ class KdbxEntry extends KdbxObject {
} }
return XmlElement(XmlName(KdbxXml.NODE_STRING)) return XmlElement(XmlName(KdbxXml.NODE_STRING))
..children.addAll([ ..children.addAll([
XmlElement(XmlName(KdbxXml.ATTR_PROTECTED)) XmlElement(XmlName(KdbxXml.ATTR_PROTECTED)),
XmlElement(XmlName(KdbxXml.NODE_KEY))
..children.add(XmlText(stringEntry.key.key)), ..children.add(XmlText(stringEntry.key.key)),
value, value,
]); ]);

4
lib/src/kdbx_object.dart

@ -68,12 +68,14 @@ abstract class KdbxObject extends KdbxNode {
@override @override
set isDirty(bool dirty) { set isDirty(bool dirty) {
super.isDirty = dirty;
if (dirty) { if (dirty) {
times.modifiedNow(); times.modifiedNow();
if (!isDirty && dirty) {
file.dirtyObject(this); file.dirtyObject(this);
} }
} }
super.isDirty = dirty;
}
@override @override
XmlElement toXml() { XmlElement toXml() {

Loading…
Cancel
Save