mirror of
https://codeberg.org/scip/Crypt--PWSafe3.git
synced 2025-12-17 04:31:00 +01:00
Added deleterecord method and test for it.
Note: I am not sure about return value. Currently I return "did I delete sth flag", alternatively one could return deleted record, or even croak if record was not there.
This commit is contained in:
@@ -470,6 +470,26 @@ sub modifyrecord {
|
||||
$this->markmodified();
|
||||
}
|
||||
|
||||
sub deleterecord {
|
||||
#
|
||||
# delete a record identified by the given uuid, if present
|
||||
#
|
||||
# returns 1 if record was actually removed, 0 if it was not present
|
||||
my($this, $uuid) = @_;
|
||||
|
||||
if (! exists $this->{record}->{$uuid}) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
delete $this->{record}->{$uuid};
|
||||
|
||||
# mark vault as modified
|
||||
$this->markmodified();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
sub markmodified {
|
||||
#
|
||||
# mark the vault as modified by setting the appropriate header fields
|
||||
|
||||
Reference in New Issue
Block a user