summaryrefslogtreecommitdiff
path: root/src/wx/screens_panel.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-03-18 23:52:58 +0100
committerCarl Hetherington <cth@carlh.net>2022-03-18 23:57:05 +0100
commit9c17e94cac5e9d48fe170b8e5288cb764d8145ad (patch)
treee7101d7c0e80ce2a01263ea05a4ea79c234e1e20 /src/wx/screens_panel.h
parent896a5eca680cf6b0605d10523cfc88bfeb4c9810 (diff)
Speed things up by sorting before adding cinemas.
Diffstat (limited to 'src/wx/screens_panel.h')
-rw-r--r--src/wx/screens_panel.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/wx/screens_panel.h b/src/wx/screens_panel.h
index 8c818f441..7a075bf49 100644
--- a/src/wx/screens_panel.h
+++ b/src/wx/screens_panel.h
@@ -52,7 +52,7 @@ public:
private:
void add_cinemas ();
- boost::optional<wxTreeListItem> add_cinema (std::shared_ptr<Cinema>);
+ boost::optional<wxTreeListItem> add_cinema (std::shared_ptr<Cinema>, wxTreeListItem previous);
boost::optional<wxTreeListItem> add_screen (std::shared_ptr<Cinema>, std::shared_ptr<dcpomatic::Screen>);
void add_cinema_clicked ();
void edit_cinema_clicked ();
@@ -67,6 +67,7 @@ private:
boost::optional<std::pair<wxTreeListItem, std::shared_ptr<Cinema>>> cinema_for_operation () const;
void set_screen_checked (wxTreeListItem item, bool checked);
void setup_cinema_checked_state (wxTreeListItem screen);
+ int compare (std::string const& utf8_a, std::string const& utf8_b);
typedef std::vector<std::pair<wxTreeListItem, std::shared_ptr<Cinema>>> Cinemas;
typedef std::vector<std::pair<wxTreeListItem, std::shared_ptr<dcpomatic::Screen>>> Screens;
@@ -106,17 +107,5 @@ private:
bool _ignore_selection_change = false;
bool _ignore_check_change = false;
- class Comparator : public wxTreeListItemComparator
- {
- public:
- Comparator ();
- ~Comparator ();
-
- int Compare (wxTreeListCtrl* tree_list, unsigned, wxTreeListItem a, wxTreeListItem b) override;
-
- private:
- UCollator* _collator;
- };
-
- Comparator _comparator;
+ UCollator* _collator = nullptr;
};