X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=lib%2FFile%2FKDBX%2FDumper%2FXML.pm;h=5b376b9e5cc820e8bbc28fc9bf6a523511c53f4a;hb=c98fc7d0294e641cf8844306808333bdec4fea2f;hp=3a9e70ba9a32b5da4d8f7fbf952df99621383492;hpb=37b09e0f2832514b33de4499a83f22d5ffe7c0a3;p=chaz%2Fp5-File-KDBX diff --git a/lib/File/KDBX/Dumper/XML.pm b/lib/File/KDBX/Dumper/XML.pm index 3a9e70b..5b376b9 100644 --- a/lib/File/KDBX/Dumper/XML.pm +++ b/lib/File/KDBX/Dumper/XML.pm @@ -178,8 +178,8 @@ sub _write_xml_binaries { my $new_ref = keys %{$self->_binaries_written}; my $written = $self->_binaries_written; - my $entries = $kdbx->all_entries(history => true); - for my $entry (@$entries) { + my $entries = $kdbx->entries(history => 1); + while (my $entry = $entries->next) { for my $key (keys %{$entry->binaries}) { my $binary = $entry->binaries->{$key}; if (defined $binary->{ref} && defined $kdbx->binaries->{$binary->{ref}}) { @@ -249,10 +249,10 @@ sub _write_xml_custom_icons { my $self = shift; my $node = shift; - my $custom_icons = $self->kdbx->meta->{custom_icons} || {}; + my $custom_icons = $self->kdbx->custom_icons; - for my $uuid (sort keys %$custom_icons) { - my $icon = $custom_icons->{$uuid}; + for my $icon (@$custom_icons) { + $icon->{uuid} && $icon->{data} or next; my $icon_node = $node->addNewChild(undef, 'Icon'); $self->_write_xml_from_pairs($icon_node, $icon, @@ -296,7 +296,7 @@ sub _write_xml_root { if (my $group = $kdbx->root) { my $group_node = $node->addNewChild(undef, 'Group'); - $self->_write_xml_group($group_node, $group->_confirmed); + $self->_write_xml_group($group_node, $group->_committed); } undef $guard; # re-lock if needed, as early as possible @@ -337,12 +337,12 @@ sub _write_xml_group { for my $entry (@{$group->entries}) { my $entry_node = $node->addNewChild(undef, 'Entry'); - $self->_write_xml_entry($entry_node, $entry->_confirmed); + $self->_write_xml_entry($entry_node, $entry->_committed); } for my $group (@{$group->groups}) { my $group_node = $node->addNewChild(undef, 'Group'); - $self->_write_xml_group($group_node, $group->_confirmed); + $self->_write_xml_group($group_node, $group->_committed); } } @@ -423,7 +423,7 @@ sub _write_xml_entry { my $history_node = $node->addNewChild(undef, 'History'); for my $historical (@history) { my $historical_node = $history_node->addNewChild(undef, 'Entry'); - $self->_write_xml_entry($historical_node, $historical->_confirmed, 1); + $self->_write_xml_entry($historical_node, $historical->_committed, 1); } } }