Logo Search packages:      
Sourcecode: pan version File versions  Download package

void TaskArticle::use_decoder ( Decoder decoder  )  [virtual]

only call this for tasks in the NEED_DECODE state attempts to acquire the saver thread and start saving returns false if failed or true if the save process started (intended to be used with the Queue class). If true is returned, a side-effect is that the task is now in the DECODING state.

Reimplemented from pan::Task.

Definition at line 304 of file task-article.cc.

References pan::Task::State::_work, pan::Quark::c_str(), pan::Decoder::enqueue(), pan::ArticleCache::get_filenames(), pan::Article::get_part_mids(), pan::Task::NEED_DECODER, pan::Task::State::set_working(), and pan::Article::subject.

  if (_state._work != NEED_DECODER)
    check_in (decoder);

  _decoder = decoder;
  const Article::mid_sequence_t mids (_article.get_part_mids());
  const ArticleCache :: strings_t filenames (_cache.get_filenames (mids));
  _decoder->enqueue (this, _save_path, filenames, _save_mode);
  set_status_va (_("Decoding %s"), _article.subject.c_str());
  debug ("decoder thread was free, enqueued work");

Generated by  Doxygen 1.6.0   Back to index