From b17e2373f2c33e13c88c44bc98411ebe2cd23ec9 Mon Sep 17 00:00:00 2001 From: Herbert Poul Date: Thu, 29 Aug 2019 10:57:13 +0200 Subject: [PATCH] fix writing of string values, also do not trigger dirty event, if entry is already dirty. --- lib/src/kdbx_entry.dart | 3 ++- lib/src/kdbx_object.dart | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/src/kdbx_entry.dart b/lib/src/kdbx_entry.dart index 8ac97a5..a8394e6 100644 --- a/lib/src/kdbx_entry.dart +++ b/lib/src/kdbx_entry.dart @@ -84,7 +84,8 @@ class KdbxEntry extends KdbxObject { } return XmlElement(XmlName(KdbxXml.NODE_STRING)) ..children.addAll([ - XmlElement(XmlName(KdbxXml.ATTR_PROTECTED)) + XmlElement(XmlName(KdbxXml.ATTR_PROTECTED)), + XmlElement(XmlName(KdbxXml.NODE_KEY)) ..children.add(XmlText(stringEntry.key.key)), value, ]); diff --git a/lib/src/kdbx_object.dart b/lib/src/kdbx_object.dart index 8baa369..a7a3499 100644 --- a/lib/src/kdbx_object.dart +++ b/lib/src/kdbx_object.dart @@ -68,11 +68,13 @@ abstract class KdbxObject extends KdbxNode { @override set isDirty(bool dirty) { - super.isDirty = dirty; if (dirty) { times.modifiedNow(); - file.dirtyObject(this); + if (!isDirty && dirty) { + file.dirtyObject(this); + } } + super.isDirty = dirty; } @override