]> git.scottworley.com Git - picsort/blobdiff - picsorter.js
Leaving the name field empty cancels
[picsort] / picsorter.js
index 6608edff15549b05a438f67626a78941d372b332..be0371afdd078a122e5eea6d526edc1210e116cb 100644 (file)
@@ -155,10 +155,12 @@ function rotate() {
 
 
 function set_name(name) {
-  picinfo[files[input_index]].name = name;
-  save_picinfo();
-  say("Named " + name);
-  last_name = name;
+  if (name) {
+    picinfo[files[input_index]].name = name;
+    save_picinfo();
+    say("Named " + name);
+    last_name = name;
+  }
 }
 
 function set_name_from_form() {
@@ -177,7 +179,7 @@ function show_commands() {
     if ("name" in picinfo[f] && picinfo[f].name.length > 0) {
       var escaped_filename = "'" + shell_escape(picinfo[f].name) + "'";
       if (picinfo[f].deleted == "deleted") {
-        commands.push("rm " + escaped_filename);
+        commands.push("shred -u " + escaped_filename);
         return;
       }
       if (picinfo[f].deleted == "extra") {