From 443a7d74ff2a49ad45a4fb44f92abd619bc0a0b0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 7 Mar 2017 10:18:06 +0000 Subject: Handle failure to write to cinemas file more nicely. --- src/lib/config.cc | 8 ++++---- src/lib/config.h | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/lib') diff --git a/src/lib/config.cc b/src/lib/config.cc index 031c046c9..6a08125cf 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -366,12 +366,12 @@ Config::instance () void Config::write () const { - write_config_xml (); - write_cinemas_xml (); + write_config (); + write_cinemas (); } void -Config::write_config_xml () const +Config::write_config () const { xmlpp::Document doc; xmlpp::Element* root = doc.create_root_node ("Config"); @@ -482,7 +482,7 @@ Config::write_config_xml () const } void -Config::write_cinemas_xml () const +Config::write_cinemas () const { xmlpp::Document doc; xmlpp::Element* root = doc.create_root_node ("Cinemas"); diff --git a/src/lib/config.h b/src/lib/config.h index 8b8d7c38a..1bdbcb96e 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -66,6 +66,7 @@ public: enum Property { USE_ANY_SERVERS, SERVERS, + CINEMAS, OTHER }; @@ -345,12 +346,12 @@ public: void add_cinema (boost::shared_ptr c) { _cinemas.push_back (c); - changed (); + changed (CINEMAS); } void remove_cinema (boost::shared_ptr c) { _cinemas.remove (c); - changed (); + changed (CINEMAS); } void set_allowed_dcp_frame_rates (std::list const & r) { @@ -539,6 +540,8 @@ public: static boost::signals2::signal FailedToLoad; void write () const; + void write_config () const; + void write_cinemas () const; void save_template (boost::shared_ptr film, std::string name) const; bool existing_template (std::string name) const; @@ -558,8 +561,6 @@ private: void read (); void set_defaults (); void set_kdm_email_to_default (); - void write_config_xml () const; - void write_cinemas_xml () const; void read_cinemas (cxml::Document const & f); boost::shared_ptr create_certificate_chain (); boost::filesystem::path directory_or (boost::optional dir, boost::filesystem::path a) const; -- cgit v1.2.3