_export.read(f.optional_node_child("Export"));
}
catch (...) {
- if (have_existing("config.xml") || have_existing("cinemas.xml") || have_existing("dkdm_recipients.xml")) {
+ if (have_existing("config.xml")) {
backup ();
/* We have a config file but it didn't load */
FailedToLoad(LoadFailure::CONFIG);
_signer_chain = create_certificate_chain ();
/* And similar for decryption of KDMs */
_decryption_chain = create_certificate_chain ();
- write ();
+ write_config();
}
Config::read_cinemas()
{
if (boost::filesystem::exists (_cinemas_file)) {
- cxml::Document f ("Cinemas");
- f.read_file (_cinemas_file);
- read_cinemas (f);
+ try {
+ cxml::Document f("Cinemas");
+ f.read_file(_cinemas_file);
+ read_cinemas(f);
+ } catch (...) {
+ backup();
+ FailedToLoad(LoadFailure::CINEMAS);
+ write_cinemas();
+ }
}
}
Config::read_dkdm_recipients()
{
if (boost::filesystem::exists (_dkdm_recipients_file)) {
- cxml::Document f ("DKDMRecipients");
- f.read_file (_dkdm_recipients_file);
- read_dkdm_recipients (f);
+ try {
+ cxml::Document f("DKDMRecipients");
+ f.read_file(_dkdm_recipients_file);
+ read_dkdm_recipients(f);
+ } catch (...) {
+ backup();
+ FailedToLoad(LoadFailure::DKDM_RECIPIENTS);
+ write_dkdm_recipients();
+ }
}
}
root->add_child("DefaultContainer")->add_child_text (_default_container->id ());
}
if (_default_dcp_content_type) {
- /* [XML:opt] DefaultDCPContentType Default content type ot use when creating new films (<code>FTR</code>, <code>SHR</code>,
+ /* [XML:opt] DefaultDCPContentType Default content type to use when creating new films (<code>FTR</code>, <code>SHR</code>,
<code>TLR</code>, <code>TST</code>, <code>XSN</code>, <code>RTG</code>, <code>TSR</code>, <code>POL</code>,
<code>PSA</code> or <code>ADV</code>). */
root->add_child("DefaultDCPContentType")->add_child_text (_default_dcp_content_type->isdcf_name ());
add_to_history_internal (_history, p);
}
-/** Remove non-existant items from the history */
+/** Remove non-existent items from the history */
void
Config::clean_history ()
{