projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't show an error when cancelling subtitle analysis.
[dcpomatic.git]
/
src
/
lib
/
send_problem_report_job.cc
diff --git
a/src/lib/send_problem_report_job.cc
b/src/lib/send_problem_report_job.cc
index e7fc02eb0e0b13437eb45007f417c09cc6710f8a..34822b1561d7ade97c41d8dd236a4c383c9888fc 100644
(file)
--- a/
src/lib/send_problem_report_job.cc
+++ b/
src/lib/send_problem_report_job.cc
@@
-38,7
+38,7
@@
using std::shared_ptr;
using std::string;
using std::string;
-/** @param film Film th
ta
the problem is with, or 0.
+/** @param film Film th
at
the problem is with, or 0.
* @param from Email address to use for From:
* @param summary Summary of the problem.
*/
* @param from Email address to use for From:
* @param summary Summary of the problem.
*/
@@
-119,19
+119,12
@@
SendProblemReportJob::run ()
void
SendProblemReportJob::add_file (string& body, boost::filesystem::path file) const
{
void
SendProblemReportJob::add_file (string& body, boost::filesystem::path file) const
{
- auto f = fopen_boost (_film->file(file), "r");
- if (!f) {
- return;
- }
-
body += file.string() + ":\n";
body += "---<8----\n";
body += file.string() + ":\n";
body += "---<8----\n";
- auto const size = boost::filesystem::file_size (_film->file(file));
- char* buffer = new char[size + 1];
- int const N = fread (buffer, 1, size, f);
- buffer[N] = '\0';
- body += buffer;
- delete[] buffer;
+ try {
+ body += dcp::file_to_string (_film->file(file));
+ } catch (...) {
+ body += "[could not be read]\n";
+ }
body += "---<8----\n\n";
body += "---<8----\n\n";
- fclose (f);
}
}