From: wmorgan Date: Thu, 1 Feb 2007 21:27:21 +0000 (+0000) Subject: progressively update display based on time rather than number of entries X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=1bc4fcb8ca70611b7d6d35dcae690d9ee62cd2f2;p=sup progressively update display based on time rather than number of entries git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@292 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index 8df0408..3eb96c7 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -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 } }