Use explicit parameters to the EditableList constructor, and allow
[dcpomatic.git] / src / wx / content_widget.h
index 34755e4b5a7e1707b710f45487bc9cdf4934dfd3..fa405b5c968ea2c5fb93a0bd590e59807b776bee 100644 (file)
 
 */
 
+
 /** @file  src/wx/content_widget.h
  *  @brief ContentWidget class.
  */
 
+
 #ifndef DCPOMATIC_CONTENT_WIDGET_H
 #define DCPOMATIC_CONTENT_WIDGET_H
 
+
 #include "wx_util.h"
 #include "lib/content.h"
-#include <wx/wx.h>
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/gbsizer.h>
 #include <wx/spinctrl.h>
+#include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
 #include <vector>
 
+
 /** @class ContentWidget
  *  @brief A widget which represents some Content state and which can be used
  *  when multiple pieces of content are selected.
@@ -92,13 +99,13 @@ public:
                return _wrapped;
        }
 
-       typedef std::vector<std::shared_ptr<Content> > List;
+       typedef std::vector<std::shared_ptr<Content>> List;
 
        /** Set the content that this control is working on (i.e. the selected content) */
        void set_content (List content)
        {
-               for (typename std::list<boost::signals2::connection>::iterator i = _connections.begin(); i != _connections.end(); ++i) {
-                       i->disconnect ();
+               for (auto& i: _connections) {
+                       i.disconnect ();
                }
 
                _connections.clear ();
@@ -109,11 +116,11 @@ public:
 
                update_from_model ();
 
-               for (typename List::iterator i = _content.begin(); i != _content.end(); ++i) {
+               for (auto i: _content) {
 #if BOOST_VERSION >= 106100
-                       _connections.push_back ((*i)->Change.connect (boost::bind (&ContentWidget::model_changed, this, boost::placeholders::_1, boost::placeholders::_3)));
+                       _connections.push_back (i->Change.connect(boost::bind(&ContentWidget::model_changed, this, boost::placeholders::_1, boost::placeholders::_3)));
 #else
-                       _connections.push_back ((*i)->Change.connect (boost::bind (&ContentWidget::model_changed, this, _1, _3)));
+                       _connections.push_back (i->Change.connect(boost::bind(&ContentWidget::model_changed, this, _1, _3)));
 #endif
                }
        }
@@ -135,7 +142,7 @@ public:
                        return;
                }
 
-               typename List::iterator i = _content.begin ();
+               auto i = _content.begin ();
                U const v = boost::bind (_model_getter, _part(_content.front().get()).get())();
                while (i != _content.end() && boost::bind (_model_getter, _part(i->get()).get())() == v) {
                        ++i;