diff options
Diffstat (limited to 'src/lib/config.cc')
| -rw-r--r-- | src/lib/config.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index 879c29279..1269206ee 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -1385,6 +1385,13 @@ Config::set_dkdm_recipients_file(boost::filesystem::path file) void +Config::save_default_template(shared_ptr<const Film> film) const +{ + film->write_template(write_path("default.xml")); +} + + +void Config::save_template (shared_ptr<const Film> film, string name) const { film->write_template (template_write_path(name)); @@ -1420,6 +1427,18 @@ Config::template_read_path (string name) const boost::filesystem::path +Config::default_template_read_path() const +{ + if (!boost::filesystem::exists(read_path("default.xml"))) { + auto film = std::make_shared<const Film>(optional<boost::filesystem::path>()); + save_default_template(film); + } + + return read_path("default.xml"); +} + + +boost::filesystem::path Config::template_write_path (string name) const { return write_path("templates") / tidy_for_filename (name); |
