X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=bin%2Fsup;h=1febefdd5bc0e06e033f6da7a86d1f5bdf2e710f;hb=9585e430151cb415e7b76acc4280ad54ded17b00;hp=e16c91bf510b05281082c86b7bacadd240f30c97;hpb=d1bb840a6b8b8b778844bc2c870db0df6fd0a532;p=sup diff --git a/bin/sup b/bin/sup old mode 100644 new mode 100755 index e16c91b..1febefd --- a/bin/sup +++ b/bin/sup @@ -5,7 +5,6 @@ require 'ncurses' require 'curses' require 'fileutils' require 'trollop' -require 'fastthread' require "sup" BIN_VERSION = "git" @@ -89,14 +88,14 @@ end ## BSD users: if libc.so.6 is not found, try installing compat6x. require 'dl/import' module LibC - extend DL::Importable + extend DL.const_defined?(:Importer) ? DL::Importer : DL::Importable setlocale_lib = case Config::CONFIG['arch'] when /darwin/; "libc.dylib" when /cygwin/; "cygwin1.dll" else; "libc.so.6" end - Redwood::log "dyamically loading setlocale() from #{setlocale_lib}" + Redwood::log "dynamically loading setlocale() from #{setlocale_lib}" begin dlload setlocale_lib extern "void setlocale(int, const char *)" @@ -161,18 +160,17 @@ begin Redwood::start Index.load - if(s = Index.source_for DraftManager.source_name) + if(s = Redwood::SourceManager.source_for DraftManager.source_name) DraftManager.source = s else Redwood::log "no draft source, auto-adding..." - Index.add_source DraftManager.new_source + Redwood::SourceManager.add_source DraftManager.new_source end - if(s = Index.source_for SentManager.source_name) + if(s = Redwood::SourceManager.source_for SentManager.source_uri) SentManager.source = s else - Redwood::log "no sent mail source, auto-adding..." - Index.add_source SentManager.new_source + Redwood::SourceManager.add_source SentManager.default_source end HookManager.run "startup" @@ -192,7 +190,7 @@ begin bm.draw_screen - Index.usual_sources.each do |s| + Redwood::SourceManager.usual_sources.each do |s| next unless s.respond_to? :connect reporting_thread("call #connect on #{s}") do begin @@ -203,7 +201,7 @@ begin end end unless $opts[:no_initial_poll] - imode.load_threads :num => ibuf.content_height, :when_done => lambda { reporting_thread("poll after loading inbox") { sleep 1; PollManager.poll } unless $opts[:no_threads] || $opts[:no_initial_poll] } + imode.load_threads :num => ibuf.content_height, :when_done => lambda { |num| reporting_thread("poll after loading inbox") { sleep 1; PollManager.poll } unless $opts[:no_threads] || $opts[:no_initial_poll] } if $opts[:compose] ComposeMode.spawn_nicely :to_default => $opts[:compose]