diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-07-09 20:41:10 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-07-11 12:22:11 +0200 |
| commit | b1e22dff981fb86ae04b12bb5a064e61030793a8 (patch) | |
| tree | ffb112f6e3f3311d8669f6a89628bf5f0bc40f2e /src | |
| parent | 736d6bf3242a0ba3841cb765e97cf9fee3540460 (diff) | |
Use a vector rather than a list when returning from content_factory().
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/content_factory.cc | 5 | ||||
| -rw-r--r-- | src/lib/content_factory.h | 3 | ||||
| -rw-r--r-- | src/tools/dcpomatic_create.cc | 5 | ||||
| -rw-r--r-- | src/wx/content_panel.cc | 2 | ||||
| -rw-r--r-- | src/wx/content_view.cc | 2 |
5 files changed, 11 insertions, 6 deletions
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index 7bcc45503..135f3fe5f 100644 --- a/src/lib/content_factory.cc +++ b/src/lib/content_factory.cc @@ -50,6 +50,7 @@ using std::list; using std::make_shared; using std::shared_ptr; using std::string; +using std::vector; /** Create a Content object from an XML node. @@ -104,10 +105,10 @@ content_factory (cxml::ConstNodePtr node, int version, list<string>& notes) * @param path File or directory. * @return Content objects. */ -list<shared_ptr<Content>> +vector<shared_ptr<Content>> content_factory (boost::filesystem::path path) { - list<shared_ptr<Content>> content; + vector<shared_ptr<Content>> content; if (boost::filesystem::is_directory (path)) { diff --git a/src/lib/content_factory.h b/src/lib/content_factory.h index 7da5435d5..2cef84034 100644 --- a/src/lib/content_factory.h +++ b/src/lib/content_factory.h @@ -25,6 +25,7 @@ #include <libcxml/cxml.h> +#include <vector> class Film; @@ -32,4 +33,4 @@ class Content; extern std::shared_ptr<Content> content_factory (cxml::ConstNodePtr, int, std::list<std::string> &); -extern std::list<std::shared_ptr<Content>> content_factory (boost::filesystem::path); +extern std::vector<std::shared_ptr<Content>> content_factory (boost::filesystem::path); diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 4c40c24d3..a4f8dda6a 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -45,6 +45,7 @@ #include <stdexcept> #include <string> + using std::cerr; using std::cout; using std::dynamic_pointer_cast; @@ -53,8 +54,10 @@ using std::list; using std::make_shared; using std::shared_ptr; using std::string; +using std::vector; using boost::optional; + class SimpleSignalManager : public SignalManager { public: @@ -117,7 +120,7 @@ main (int argc, char* argv[]) for (auto cli_content: cc.content) { auto const can = boost::filesystem::canonical (cli_content.path); - list<shared_ptr<Content>> film_content_list; + vector<shared_ptr<Content>> film_content_list; if (boost::filesystem::exists (can / "ASSETMAP") || (boost::filesystem::exists (can / "ASSETMAP.xml"))) { auto dcp = make_shared<DCPContent>(can); diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index a7c9a4454..5f3b3e476 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -483,7 +483,7 @@ ContentPanel::add_folder_clicked () return; } - list<shared_ptr<Content> > content; + vector<shared_ptr<Content>> content; try { content = content_factory (path); diff --git a/src/wx/content_view.cc b/src/wx/content_view.cc index 802569879..95b481e0b 100644 --- a/src/wx/content_view.cc +++ b/src/wx/content_view.cc @@ -99,7 +99,7 @@ ContentView::update () } else if (i.path().extension() == ".mp4") { auto all_content = content_factory(i); if (!all_content.empty()) { - content = all_content.front(); + content = all_content[0]; } } |
