]> git.notmuchmail.org Git - sup/commitdiff
progressively update display based on time rather than number of entries
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 1 Feb 2007 21:27:21 +0000 (21:27 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 1 Feb 2007 21:27:21 +0000 (21:27 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@292 5c8cc53c-5e98-4d25-b20a-d8db53a31250

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

index 8df0408d1092a96de8e13b68651d1d6e4fdc9586..3eb96c73831f1617f21d0bb0aae47bd5f06e2011 100644 (file)
@@ -320,11 +320,13 @@ class ThreadIndexMode < LineCursorMode
   def load_n_threads n=LOAD_MORE_THREAD_NUM, opts={}
     @mbid = BufferManager.say "Searching for threads..."
     orig_size = @ts.size
+    last_update = Time.now
     @ts.load_n_threads(@ts.size + n, opts) do |i|
       BufferManager.say "Loaded #{i} threads...", @mbid
-      if i % 5 == 0
+      if (Time.now - last_update) >= 0.25
         update
         BufferManager.draw_screen
+        last_update = Time.now
       end
     end
     @ts.threads.each { |th| th.labels.each { |l| LabelManager << l } }