diff --git a/Libraries/LibGUI/GModelSelection.h b/Libraries/LibGUI/GModelSelection.h index 33430508ef..4c0c011336 100644 --- a/Libraries/LibGUI/GModelSelection.h +++ b/Libraries/LibGUI/GModelSelection.h @@ -12,6 +12,7 @@ public: { } + int size() const { return m_indexes.size(); } bool is_empty() const { return m_indexes.is_empty(); } bool contains(const GModelIndex& index) const { return m_indexes.contains(index); } bool contains_row(int row) const @@ -36,6 +37,13 @@ public: callback(index); } + template + void for_each_index(Callback callback) const + { + for (auto& index : m_indexes) + callback(index); + } + // FIXME: This doesn't guarantee that what you get is the lowest or "first" index selected.. GModelIndex first() const {