diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-12-20 16:18:24 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-12-20 16:18:24 +0000 |
| commit | 3476f2f8251d5800abdd968963cac57b0df8a657 (patch) | |
| tree | dea2e82b66f7da44387023fe0c662253dfcec777 /src/wx/content_menu.cc | |
| parent | f8e6fdee828647bc5a6a1cc7627052a072a37dc6 (diff) | |
Allow content factory to return multiple content.
Diffstat (limited to 'src/wx/content_menu.cc')
| -rw-r--r-- | src/wx/content_menu.cc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 0240a8c33..429699956 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -278,8 +278,6 @@ ContentMenu::find_missing () return; } - shared_ptr<Content> content; - /* XXX: a bit nasty */ shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (_content.front ()); shared_ptr<DCPContent> dc = dynamic_pointer_cast<DCPContent> (_content.front ()); @@ -299,27 +297,31 @@ ContentMenu::find_missing () d->Destroy (); } + list<shared_ptr<Content> > content; + if (r == wxID_OK) { content = content_factory (film, path); } - if (!content) { + if (content.empty ()) { return; } - shared_ptr<Job> j (new ExamineContentJob (film, content)); + BOOST_FOREACH (shared_ptr<Content> i, content) { + shared_ptr<Job> j (new ExamineContentJob (film, i)); - j->Finished.connect ( - bind ( - &ContentMenu::maybe_found_missing, - this, - boost::weak_ptr<Job> (j), - boost::weak_ptr<Content> (_content.front ()), - boost::weak_ptr<Content> (content) - ) - ); + j->Finished.connect ( + bind ( + &ContentMenu::maybe_found_missing, + this, + boost::weak_ptr<Job> (j), + boost::weak_ptr<Content> (_content.front ()), + boost::weak_ptr<Content> (i) + ) + ); - JobManager::instance()->add (j); + JobManager::instance()->add (j); + } } void |
