Browse Source

fix tests with missing kdbx context.

remove-cryptography-dependency
Herbert Poul 5 years ago
parent
commit
88829d27d4
  1. 2
      lib/src/kdbx_dao.dart
  2. 2
      lib/src/kdbx_entry.dart
  3. 2
      lib/src/kdbx_format.dart
  4. 6
      lib/src/kdbx_group.dart
  5. 5
      lib/src/kdbx_object.dart

2
lib/src/kdbx_dao.dart

@ -10,7 +10,7 @@ extension KdbxDao on KdbxFile {
@required String name,
}) {
assert(parent != null, name != null);
final newGroup = KdbxGroup.create(parent: parent, name: name);
final newGroup = KdbxGroup.create(ctx: ctx, parent: parent, name: name);
parent.addGroup(newGroup);
return newGroup;
}

2
lib/src/kdbx_entry.dart

@ -36,7 +36,7 @@ class KdbxEntry extends KdbxObject {
KdbxEntry.create(KdbxFile file, KdbxGroup parent)
: isHistoryEntry = false,
history = [],
super.create(file, 'Entry', parent) {
super.create(file.ctx, file, 'Entry', parent) {
icon.set(KdbxIcon.Key);
}

2
lib/src/kdbx_format.dart

@ -305,7 +305,7 @@ class KdbxFormat {
ctx: ctx,
generator: generator,
);
final rootGroup = KdbxGroup.create(parent: null, name: name);
final rootGroup = KdbxGroup.create(ctx: ctx, parent: null, name: name);
final body = KdbxBody.create(meta, rootGroup);
return KdbxFile(
ctx,

6
lib/src/kdbx_group.dart

@ -8,8 +8,12 @@ import 'package:xml/xml.dart';
import 'kdbx_object.dart';
class KdbxGroup extends KdbxObject {
KdbxGroup.create({@required KdbxGroup parent, @required String name})
KdbxGroup.create(
{@required KdbxReadWriteContext ctx,
@required KdbxGroup parent,
@required String name})
: super.create(
ctx,
parent?.file,
'Group',
parent,

5
lib/src/kdbx_object.dart

@ -71,8 +71,9 @@ abstract class KdbxNode with Changeable<KdbxNode> {
}
abstract class KdbxObject extends KdbxNode {
KdbxObject.create(this.file, String nodeName, KdbxGroup parent)
: times = KdbxTimes.create(file.ctx),
KdbxObject.create(
KdbxReadWriteContext ctx, this.file, String nodeName, KdbxGroup parent)
: times = KdbxTimes.create(ctx),
_parent = parent,
super.create(nodeName) {
_uuid.set(KdbxUuid.random());

Loading…
Cancel
Save