]> git.notmuchmail.org Git - sup/commitdiff
better 'saving thread' messages
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Tue, 3 Apr 2007 15:55:36 +0000 (15:55 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Tue, 3 Apr 2007 15:55:36 +0000 (15:55 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@374 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/thread-index-mode.rb

index 68ee1ee6e4b37672bba38ff3393c85f4172043d2..7bfb9ead8c5142b88f62f7faa20a3b966e858c15 100644 (file)
@@ -241,12 +241,12 @@ class ThreadIndexMode < LineCursorMode
   end
 
   def save
-    threads = @threads + @hidden_threads.keys
+    dirty_threads = (@threads + @hidden_threads.keys).select { |t| t.dirty? }
+    return if dirty_threads.empty?
 
     BufferManager.say("Saving threads...") do |say_id|
-      threads.each_with_index do |t, i|
-        next unless t.dirty?
-        BufferManager.say "Saving thread #{i +1} of #{threads.length}...", say_id
+      dirty_threads.each_with_index do |t, i|
+        BufferManager.say "Saving modified thread #{i + 1} of #{dirty_threads.length}...", say_id
         t.save Index
       end
     end