Hand-apply 6a3cd511559433554ab40ed72ff94b7d8dc2c5bd from master;
[dcpomatic.git] / src / lib / content.cc
index bbbe9b6ce4bdd4dd5ff6b8dcf231c8d08126e253..6e02183233da9f6f288794d61de2835bc439c8d1 100644 (file)
 #include "ui_signaller.h"
 #include "exceptions.h"
 #include "film.h"
+#include "safe_stringstream.h"
+#include "job.h"
 
 #include "i18n.h"
 
 using std::string;
-using std::stringstream;
 using std::set;
 using std::list;
 using std::cout;
@@ -131,8 +132,14 @@ Content::as_xml (xmlpp::Node* node) const
 }
 
 void
-Content::examine (shared_ptr<Job> job)
+Content::examine (shared_ptr<Job> job, bool calculate_digest)
 {
+       if (!calculate_digest) {
+               return;
+       }
+
+       job->sub (_("Computing digest"));
+       
        boost::mutex::scoped_lock lm (_mutex);
        vector<boost::filesystem::path> p = _paths;
        lm.unlock ();
@@ -225,7 +232,7 @@ Content::length_after_trim () const
 string
 Content::identifier () const
 {
-       stringstream s;
+       SafeStringStream s;
        
        s << Content::digest()
          << "_" << position().get()