/* DKDMs are not considered a thing to reset on set_defaults() */
: _dkdms (new DKDMGroup ("root"))
, _default_kdm_duration (1, RoughDuration::Unit::WEEKS)
+ , _export(this)
{
set_defaults ();
}
set_kdm_email_to_default ();
set_notification_email_to_default ();
set_cover_sheet_to_default ();
+
+ _export.set_defaults();
}
void
}
_auto_crop_threshold = f.optional_number_child<double>("AutoCropThreshold").get_value_or(0.1);
+ _export.read(f.optional_node_child("Export"));
+
if (boost::filesystem::exists (_cinemas_file)) {
cxml::Document f ("Cinemas");
f.read_file (_cinemas_file);
root->add_child("DefaultKDMType")->add_child_text(dcp::formulation_to_string(_default_kdm_type));
root->add_child("AutoCropThreshold")->add_child_text(raw_convert<string>(_auto_crop_threshold));
+ _export.write(root->add_child("Export"));
+
auto target = config_write_file();
try {
auto const s = doc.write_to_string_formatted ();
boost::filesystem::path tmp (string(target.string()).append(".tmp"));
- auto f = fopen_boost (tmp, "w");
+ dcp::File f(tmp, "w");
if (!f) {
throw FileError (_("Could not open file for writing"), tmp);
}
- checked_fwrite (s.c_str(), s.bytes(), f, tmp);
- fclose (f);
+ f.checked_write(s.c_str(), s.bytes());
+ f.close();
boost::filesystem::remove (target);
boost::filesystem::rename (tmp, target);
} catch (xmlpp::exception& e) {
bool
Config::have_write_permission () const
{
- auto f = fopen_boost (config_write_file(), "r+");
- if (!f) {
- return false;
- }
-
- fclose (f);
- return true;
+ dcp::File f(config_write_file(), "r+");
+ return static_cast<bool>(f);
}
/** @param output_channels Number of output channels in use.