diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-08-24 16:45:34 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-08-24 16:45:34 +0100 |
| commit | 73407f943ba25e2a0df2c98b3a9a938132876e9f (patch) | |
| tree | 3f50da759546b4e15bbb076bfafd8afe4509421b /src/lib/config.cc | |
| parent | 8e7bdee30563e9e334bc99387315124557ad0227 (diff) | |
Add a basic management dialogue for templates.
Diffstat (limited to 'src/lib/config.cc')
| -rw-r--r-- | src/lib/config.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index 8f9cfab4b..1d9cce64e 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -597,7 +597,7 @@ Config::save_template (shared_ptr<const Film> film, string name) const } list<string> -Config::template_names () const +Config::templates () const { list<string> n; for (boost::filesystem::directory_iterator i (path("templates")); i != boost::filesystem::directory_iterator(); ++i) { @@ -617,3 +617,15 @@ Config::template_path (string name) const { return path("templates") / tidy_for_filename (name); } + +void +Config::rename_template (string old_name, string new_name) const +{ + boost::filesystem::rename (template_path (old_name), template_path (new_name)); +} + +void +Config::delete_template (string name) const +{ + boost::filesystem::remove (template_path (name)); +} |
