[Pkg-privacy-commits] [libgsecuredelete] 13/168: Added a cleanup of files to remove after remove.
Ulrike Uhlig
u-guest at moszumanska.debian.org
Thu Jul 7 20:06:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
u-guest pushed a commit to branch master
in repository libgsecuredelete.
commit 4bcd28f4f5c61a8357a8573bd581e9f64760bb2c
Author: Colomban Wendling <ban at herbesfolles.org>
Date: Wed Sep 30 00:02:55 2009 +0200
Added a cleanup of files to remove after remove.
Implemented cleanup() to clean the data after a subprocess call.
Also renamed "pathes" to the correct spelling, "paths".
---
gsecuredelete/delete-operation.vala | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/gsecuredelete/delete-operation.vala b/gsecuredelete/delete-operation.vala
index 965b1ca..5f97aec 100644
--- a/gsecuredelete/delete-operation.vala
+++ b/gsecuredelete/delete-operation.vala
@@ -23,7 +23,7 @@ namespace SecureDelete
{
public class DeleteOperation : AsyncOperation
{
- private List<string> pathes;
+ private List<string> paths;
private uint n_files = 0;
/* properties */
@@ -32,14 +32,14 @@ namespace SecureDelete
get; set; default = false;
}
- /* adds a path to the list of pathes to remove */
+ /* adds a path to the list of paths to remove */
public void add_path (string path)
requires (! this.busy)
{
- this.pathes.append (path);
+ this.paths.append (path);
}
- /* removes a path from the list of pathes to remove */
+ /* removes a path from the list of paths to remove */
public void remove_path (string path)
requires (! this.busy)
{
@@ -47,12 +47,12 @@ namespace SecureDelete
* (e.g. /aa/../bb is the same as /bb) */
weak List<string> link;
- link = this.pathes.find_custom (path,
- (a, b) => {
- return (string)a == (string)b ? 0 : 1;
- });
+ link = this.paths.find_custom (path,
+ (a, b) => {
+ return (string)a == (string)b ? 0 : 1;
+ });
if (link != null) {
- this.pathes.delete_link (link);
+ this.paths.delete_link (link);
}
}
@@ -69,7 +69,7 @@ namespace SecureDelete
args += "-f";
}
this.n_files = 0;
- foreach (string path in this.pathes) {
+ foreach (string path in this.paths) {
args += path;
this.n_files++;
}
@@ -82,6 +82,12 @@ namespace SecureDelete
return args;
}
+ private override void cleanup ()
+ {
+ /* empty the paths' list not to try to remove them again at next call */
+ this.paths = null;
+ }
+
private override uint get_max_progress ()
{
/* FIXME: 38 is the standard SRM pass number, but may change with options
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/libgsecuredelete.git
More information about the Pkg-privacy-commits
mailing list