diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-06-21 23:55:05 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-06-21 23:55:05 +0200 |
| commit | d0a85f18ad5b0b2eacaa2c7071a0565ce6eb05d2 (patch) | |
| tree | 4a796c5ce9f4441ef90d7b9186c3ec10dd66e633 | |
| parent | 4c844fec0b5d2e7eb8de1f2cb84c93e3516e5728 (diff) | |
Use std::vector for add_files.
| -rw-r--r-- | src/wx/content_panel.cc | 12 | ||||
| -rw-r--r-- | src/wx/content_panel.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index d1859b894..68f6f1b94 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -441,9 +441,9 @@ ContentPanel::add_file_clicked () wxArrayString paths; d->GetPaths (paths); - list<boost::filesystem::path> path_list; + vector<boost::filesystem::path> path_list; for (unsigned int i = 0; i < paths.GetCount(); ++i) { - path_list.push_back (wx_to_std (paths[i])); + path_list.push_back (wx_to_std(paths[i])); } add_files (path_list); @@ -788,9 +788,9 @@ ContentPanel::files_dropped (wxDropFilesEvent& event) } auto paths = event.GetFiles (); - list<boost::filesystem::path> path_list; + vector<boost::filesystem::path> path_list; for (int i = 0; i < event.GetNumberOfFiles(); i++) { - path_list.push_back (wx_to_std (paths[i])); + path_list.push_back (wx_to_std(paths[i])); } add_files (path_list); @@ -798,14 +798,14 @@ ContentPanel::files_dropped (wxDropFilesEvent& event) void -ContentPanel::add_files (list<boost::filesystem::path> paths) +ContentPanel::add_files (vector<boost::filesystem::path> paths) { /* It has been reported that the paths returned from e.g. wxFileDialog are not always sorted; I can't reproduce that, but sort them anyway. Don't use ImageFilenameSorter as a normal alphabetical sort is expected here. */ - paths.sort (CaseInsensitiveSorter ()); + std::sort (paths.begin(), paths.end(), CaseInsensitiveSorter()); /* XXX: check for lots of files here and do something */ diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index aca818118..e25dedcea 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -126,7 +126,7 @@ private: void setup (); void setup_sensitivity (); - void add_files (std::list<boost::filesystem::path>); + void add_files (std::vector<boost::filesystem::path>); std::list<ContentSubPanel *> panels () const; LimitedSplitter* _splitter; |
