LibGUI: Remove an unnecessarily specific inline capacity

This commit is contained in:
Dawid Wolosowicz 2021-09-07 16:16:02 +02:00 committed by Ali Mohammad Pur
parent 8419eef85e
commit 2d91ba2737
Notes: sideshowbarker 2024-07-18 04:26:30 +09:00
8 changed files with 10 additions and 10 deletions

View file

@ -738,11 +738,11 @@ void FileSystemModel::set_data(const ModelIndex& index, const Variant& data)
}
}
Vector<ModelIndex, 1> FileSystemModel::matches(const StringView& searching, unsigned flags, const ModelIndex& index)
Vector<ModelIndex> FileSystemModel::matches(const StringView& searching, unsigned flags, const ModelIndex& index)
{
Node& node = const_cast<Node&>(this->node(index));
node.reify_if_needed();
Vector<ModelIndex, 1> found_indices;
Vector<ModelIndex> found_indices;
for (auto& child : node.m_children) {
if (string_matches(child.name, searching, flags)) {
const_cast<Node&>(child).reify_if_needed();

View file

@ -132,7 +132,7 @@ public:
virtual bool is_editable(const ModelIndex&) const override;
virtual bool is_searchable() const override { return true; }
virtual void set_data(const ModelIndex&, const Variant&) override;
virtual Vector<ModelIndex, 1> matches(const StringView&, unsigned = MatchesFlag::AllMatching, const ModelIndex& = ModelIndex()) override;
virtual Vector<ModelIndex> matches(const StringView&, unsigned = MatchesFlag::AllMatching, const ModelIndex& = ModelIndex()) override;
virtual void invalidate() override;
static String timestamp_string(time_t timestamp)

View file

@ -104,7 +104,7 @@ bool FilteringProxyModel::is_searchable() const
return m_model.is_searchable();
}
Vector<ModelIndex, 1> FilteringProxyModel::matches(const StringView& searching, unsigned flags, const ModelIndex& index)
Vector<ModelIndex> FilteringProxyModel::matches(const StringView& searching, unsigned flags, const ModelIndex& index)
{
auto found_indices = m_model.matches(searching, flags, index);
for (size_t i = 0; i < found_indices.size(); i++)

View file

@ -29,7 +29,7 @@ public:
virtual void invalidate() override;
virtual ModelIndex index(int row, int column = 0, const ModelIndex& parent = ModelIndex()) const override;
virtual bool is_searchable() const override;
virtual Vector<ModelIndex, 1> matches(const StringView&, unsigned = MatchesFlag::AllMatching, const ModelIndex& = ModelIndex()) override;
virtual Vector<ModelIndex> matches(const StringView&, unsigned = MatchesFlag::AllMatching, const ModelIndex& = ModelIndex()) override;
void set_filter_term(const StringView& term);

View file

@ -78,9 +78,9 @@ public:
}
virtual bool is_searchable() const override { return true; }
virtual Vector<GUI::ModelIndex, 1> matches(StringView const& searching, unsigned flags, GUI::ModelIndex const&) override
virtual Vector<GUI::ModelIndex> matches(StringView const& searching, unsigned flags, GUI::ModelIndex const&) override
{
Vector<GUI::ModelIndex, 1> found_indices;
Vector<GUI::ModelIndex> found_indices;
if constexpr (IsTwoDimensional) {
for (auto it = m_data.begin(); it != m_data.end(); ++it) {
for (auto it2d = (*it).begin(); it2d != (*it).end(); ++it2d) {

View file

@ -75,7 +75,7 @@ public:
virtual void set_data(const ModelIndex&, const Variant&) { }
virtual int tree_column() const { return 0; }
virtual bool accepts_drag(const ModelIndex&, const Vector<String>& mime_types) const;
virtual Vector<ModelIndex, 1> matches(const StringView&, unsigned = MatchesFlag::AllMatching, const ModelIndex& = ModelIndex()) { return {}; }
virtual Vector<ModelIndex> matches(const StringView&, unsigned = MatchesFlag::AllMatching, const ModelIndex& = ModelIndex()) { return {}; }
virtual bool is_column_sortable([[maybe_unused]] int column_index) const { return true; }
virtual void sort([[maybe_unused]] int column, SortOrder) { }

View file

@ -288,7 +288,7 @@ bool SortingProxyModel::is_searchable() const
return source().is_searchable();
}
Vector<ModelIndex, 1> SortingProxyModel::matches(const StringView& searching, unsigned flags, const ModelIndex& proxy_index)
Vector<ModelIndex> SortingProxyModel::matches(const StringView& searching, unsigned flags, const ModelIndex& proxy_index)
{
auto found_indices = source().matches(searching, flags, map_to_source(proxy_index));
for (size_t i = 0; i < found_indices.size(); i++)

View file

@ -28,7 +28,7 @@ public:
virtual bool is_editable(const ModelIndex&) const override;
virtual bool is_searchable() const override;
virtual void set_data(const ModelIndex&, const Variant&) override;
virtual Vector<ModelIndex, 1> matches(const StringView&, unsigned = MatchesFlag::AllMatching, const ModelIndex& = ModelIndex()) override;
virtual Vector<ModelIndex> matches(const StringView&, unsigned = MatchesFlag::AllMatching, const ModelIndex& = ModelIndex()) override;
virtual bool accepts_drag(const ModelIndex&, const Vector<String>& mime_types) const override;
virtual bool is_column_sortable(int column_index) const override;