fix not emptying $todelete enough (on save file for example); do not abort on deletio...
authorGuillaume Cottenceau <gcottenc@gmail.com>
Mon, 23 Nov 2009 12:40:45 +0000 (13:40 +0100)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Mon, 23 Nov 2009 12:40:45 +0000 (13:40 +0100)
bin/booh

index 850aade..019464d 100644 (file)
--- a/bin/booh
+++ b/bin/booh
@@ -1891,8 +1891,13 @@ def save_current_file_user
 
     msg 3, "performing actual deletion of: " + $todelete.join(', ')
     $todelete.each { |f|
-        File.delete(f)
+        begin
+            File.delete(f)
+        rescue
+            puts "Failed to delete #{f}: #{$!}"
+        end
     }
+    $todelete = []
 end
 
 def mark_document_as_dirty
@@ -1949,7 +1954,6 @@ def ask_save_modifications(msg1, msg2, *options)
             if response == Gtk::Dialog::RESPONSE_CANCEL
                 ret = false
             end
-            $todelete = []  #- unconditionally clear the list of images/videos to delete
         }
     end
     return ret