Don't read DCP directory if we're not looking at it.
authorCarl Hetherington <cth@carlh.net>
Fri, 28 Sep 2018 15:23:22 +0000 (16:23 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 28 Sep 2018 15:23:22 +0000 (16:23 +0100)
src/wx/controls.cc

index df2c161..a5cc1dc 100644 (file)
@@ -510,6 +510,9 @@ void
 Controls::show_extended_player_controls (bool s)
 {
        _cpl->Show (s);
+       if (s) {
+               update_dcp_directory ();
+       }
        _spl_view->Show (s);
        _log->Show (s);
        _add_button->Show (s);
@@ -550,6 +553,10 @@ Controls::add_cpl_to_list (shared_ptr<dcp::CPL> cpl, wxListCtrl* ctrl)
 void
 Controls::update_dcp_directory ()
 {
+       if (!_cpl->IsShown()) {
+               return;
+       }
+
        using namespace boost::filesystem;
 
        _cpl->DeleteAllItems ();