diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-05-18 22:21:33 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-05-18 22:21:33 +0200 |
| commit | 9f125fddff88bf62d36381f9d3f09e5240b033d5 (patch) | |
| tree | 586e3040791a634f58e3c0d04e7550490af732f6 /src/wx | |
| parent | c407bf65787162ea712595eecf9fbb409c7f0d1e (diff) | |
Cleanup: replace some list with vector.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/cinema_dialog.cc | 16 | ||||
| -rw-r--r-- | src/wx/cinema_dialog.h | 5 | ||||
| -rw-r--r-- | src/wx/recipient_dialog.cc | 9 | ||||
| -rw-r--r-- | src/wx/recipient_dialog.h | 4 |
4 files changed, 10 insertions, 24 deletions
diff --git a/src/wx/cinema_dialog.cc b/src/wx/cinema_dialog.cc index 8c7194c4a..84fde5f41 100644 --- a/src/wx/cinema_dialog.cc +++ b/src/wx/cinema_dialog.cc @@ -28,7 +28,6 @@ using std::back_inserter; using std::copy; using std::cout; -using std::list; using std::string; using std::vector; using boost::bind; @@ -37,7 +36,7 @@ using namespace boost::placeholders; #endif -CinemaDialog::CinemaDialog (wxWindow* parent, wxString title, string name, list<string> emails, string notes, int utc_offset_hour, int utc_offset_minute) +CinemaDialog::CinemaDialog(wxWindow* parent, wxString title, string name, vector<string> emails, string notes, int utc_offset_hour, int utc_offset_minute) : wxDialog (parent, wxID_ANY, title) { auto overall_sizer = new wxBoxSizer (wxVERTICAL); @@ -69,7 +68,7 @@ CinemaDialog::CinemaDialog (wxWindow* parent, wxString title, string name, list< vector<EditableListColumn> columns; columns.push_back (EditableListColumn(_("Address"), 500, true)); _email_list = new EditableList<string, EmailDialog> ( - this, columns, bind (&CinemaDialog::get_emails, this), bind (&CinemaDialog::set_emails, this, _1), [](string s, int) { + this, columns, bind(&CinemaDialog::emails, this), bind (&CinemaDialog::set_emails, this, _1), [](string s, int) { return s; }, EditableListTitle::INVISIBLE, EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE ); @@ -117,21 +116,12 @@ CinemaDialog::set_emails (vector<string> e) vector<string> -CinemaDialog::get_emails () const +CinemaDialog::emails() const { return _emails; } -list<string> -CinemaDialog::emails () const -{ - list<string> e; - copy (_emails.begin(), _emails.end(), back_inserter(e)); - return e; -} - - int CinemaDialog::utc_offset_hour () const { diff --git a/src/wx/cinema_dialog.h b/src/wx/cinema_dialog.h index a878e6055..0b8362843 100644 --- a/src/wx/cinema_dialog.h +++ b/src/wx/cinema_dialog.h @@ -37,7 +37,7 @@ public: wxWindow *, wxString, std::string name = "", - std::list<std::string> emails = std::list<std::string> (), + std::vector<std::string> emails = std::vector<std::string>(), std::string notes = "", int utc_offset_hour = 0, int utc_offset_minute = 0 @@ -45,12 +45,11 @@ public: std::string name () const; std::string notes () const; - std::list<std::string> emails () const; + std::vector<std::string> emails () const; int utc_offset_hour () const; int utc_offset_minute () const; private: - std::vector<std::string> get_emails () const; void set_emails (std::vector<std::string>); wxTextCtrl* _name; diff --git a/src/wx/recipient_dialog.cc b/src/wx/recipient_dialog.cc index b685f884a..b166f265d 100644 --- a/src/wx/recipient_dialog.cc +++ b/src/wx/recipient_dialog.cc @@ -38,7 +38,6 @@ LIBDCP_ENABLE_WARNINGS using std::cout; -using std::list; using std::string; using std::vector; using boost::bind; @@ -56,7 +55,7 @@ column (string s) RecipientDialog::RecipientDialog ( - wxWindow* parent, wxString title, string name, string notes, list<string> emails, int utc_offset_hour, int utc_offset_minute, optional<dcp::Certificate> recipient + wxWindow* parent, wxString title, string name, string notes, vector<string> emails, int utc_offset_hour, int utc_offset_minute, optional<dcp::Certificate> recipient ) : wxDialog (parent, wxID_ANY, title) , _recipient (recipient) @@ -233,12 +232,10 @@ RecipientDialog::set_emails (vector<string> e) } -list<string> +vector<string> RecipientDialog::emails () const { - list<string> e; - copy (_emails.begin(), _emails.end(), back_inserter(e)); - return e; + return _emails; } diff --git a/src/wx/recipient_dialog.h b/src/wx/recipient_dialog.h index 2ed6d3f31..a46e67af5 100644 --- a/src/wx/recipient_dialog.h +++ b/src/wx/recipient_dialog.h @@ -43,7 +43,7 @@ public: wxString, std::string name = "", std::string notes = "", - std::list<std::string> emails = std::list<std::string>(), + std::vector<std::string> emails = std::vector<std::string>(), int utc_offset_hour = 0, int utc_offset_minute = 0, boost::optional<dcp::Certificate> c = boost::optional<dcp::Certificate>() @@ -52,7 +52,7 @@ public: std::string name () const; std::string notes () const; boost::optional<dcp::Certificate> recipient () const; - std::list<std::string> emails () const; + std::vector<std::string> emails () const; int utc_offset_hour () const; int utc_offset_minute () const; |
