Add a stored list of DKDMs to the creator rather than just a load button (#767).
[dcpomatic.git] / src / lib / config.cc
index b9e25e37a9afc9720153eb1f65270218412b7ae2..54d42a1b94899b405759673d4acf6e5db01f53f2 100644 (file)
@@ -284,6 +284,12 @@ Config::read ()
        } else {
                _decryption_chain = create_certificate_chain ();
        }
+
+       list<cxml::NodePtr> dkdm = f.node_children ("DKDM");
+       BOOST_FOREACH (cxml::NodePtr i, f.node_children ("DKDM")) {
+               _dkdms.push_back (dcp::EncryptedKDM (i->content ()));
+       }
+
 }
 
 /** @return Filename to write configuration to */
@@ -416,6 +422,10 @@ Config::write () const
                root->add_child("History")->add_child_text (i->string ());
        }
 
+       BOOST_FOREACH (dcp::EncryptedKDM i, _dkdms) {
+               root->add_child("DKDM")->add_child_text (i.as_xml ());
+       }
+
        try {
                doc.write_to_file_formatted (file().string ());
        } catch (xmlpp::exception& e) {