using std::string;
using std::list;
using std::cout;
-using std::stringstream;
using boost::shared_ptr;
Job::Job (shared_ptr<const Film> f)
void
Job::set_error (string s, string d)
{
- _film->log()->log (String::compose ("Error in job: %1 (%2)", s, d));
+ _film->log()->log (String::compose ("Error in job: %1 (%2)", s, d), Log::TYPE_ERROR);
boost::mutex::scoped_lock lm (_state_mutex);
_error_summary = s;
_error_details = d;
pc = 99;
}
- stringstream s;
+ SafeStringStream s;
if (!finished ()) {
s << pc << N_("%");
if (p >= 0 && t > 10 && r > 0) {
return s.str ();
}
-string
-Job::json_status () const
-{
- boost::mutex::scoped_lock lm (_state_mutex);
-
- switch (_state) {
- case NEW:
- return N_("new");
- case RUNNING:
- return N_("running");
- case PAUSED:
- return N_("paused");
- case FINISHED_OK:
- return N_("finished_ok");
- case FINISHED_ERROR:
- return N_("finished_error");
- case FINISHED_CANCELLED:
- return N_("finished_cancelled");
- }
-
- return "";
-}
-
/** @return An estimate of the remaining time for this sub-job, in seconds */
int
Job::remaining_time () const