_custom_languages.clear ();
_add_files_path = boost::none;
_auto_crop_threshold = 0.1;
+ _use_isdcf_name_by_default = true;
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
while (n < 100 && exists(add_number(path_to_copy, n))) {
++n;
}
- copy_file(path_to_copy, add_number(path_to_copy, n));
+ boost::system::error_code ec;
+ copy_file(path_to_copy, add_number(path_to_copy, n), ec);
};
/* Make a backup copy of any config.xml, cinemas.xml, dkdm_recipients.xml that we might be about
* and decide to overwrite it with a new one (possibly losing important details in the corrupted
* file). But we might as well back up the other files while we're about it.
*/
- try {
- /* This uses the State::write_path stuff so, e.g. for a current version 2.16 we might copy
- * ~/.config/dcpomatic2/2.16/config.xml to ~/.config/dcpomatic2/2.16/config.xml.1
- */
- copy_adding_number (config_write_file());
- /* These do not use State::write_path, so whatever path is in the Config we will copy
- * adding a number.
- */
- copy_adding_number (_cinemas_file);
- copy_adding_number (_dkdm_recipients_file);
- } catch (...) {}
+ /* This uses the State::write_path stuff so, e.g. for a current version 2.16 we might copy
+ * ~/.config/dcpomatic2/2.16/config.xml to ~/.config/dcpomatic2/2.16/config.xml.1
+ */
+ copy_adding_number (config_write_file());
+
+ /* These do not use State::write_path, so whatever path is in the Config we will copy
+ * adding a number.
+ */
+ copy_adding_number (_cinemas_file);
+ copy_adding_number (_dkdm_recipients_file);
}
void
_add_files_path = f.optional_string_child("AddFilesPath");
_auto_crop_threshold = f.optional_number_child<double>("AutoCropThreshold").get_value_or(0.1);
+ _use_isdcf_name_by_default = f.optional_bool_child("UseISDCFNameByDefault").get_value_or(true);
if (boost::filesystem::exists (_cinemas_file)) {
cxml::Document f ("Cinemas");
}
}
catch (...) {
- if (have_existing ("config.xml")) {
+ if (have_existing("config.xml") || have_existing("cinemas.xml") || have_existing("dkdm_recipients.xml")) {
backup ();
/* We have a config file but it didn't load */
FailedToLoad ();
Config *
Config::instance ()
{
- if (_instance == 0) {
+ if (_instance == nullptr) {
_instance = new Config;
_instance->read ();
}
root->add_child("AddFilesPath")->add_child_text(_add_files_path->string());
}
root->add_child("AutoCropThreshold")->add_child_text(raw_convert<string>(_auto_crop_threshold));
+ root->add_child("UseISDCFNameByDefault")->add_child_text(_use_isdcf_name_by_default ? "1" : "0");
auto target = config_write_file();