LibGUI: Remove an unnecessarily specific inline capacity
This commit is contained in:
parent
8419eef85e
commit
2d91ba2737
Notes:
sideshowbarker
2024-07-18 04:26:30 +09:00
Author: https://github.com/d1823 Commit: https://github.com/SerenityOS/serenity/commit/2d91ba27375 Pull-request: https://github.com/SerenityOS/serenity/pull/9790 Reviewed-by: https://github.com/alimpfard ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
8 changed files with 10 additions and 10 deletions
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) { }
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue