mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:27:42 +00:00
LibGUI: Remove an unnecessarily specific inline capacity
This commit is contained in:
parent
8419eef85e
commit
2d91ba2737
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& node = const_cast<Node&>(this->node(index));
|
||||||
node.reify_if_needed();
|
node.reify_if_needed();
|
||||||
Vector<ModelIndex, 1> found_indices;
|
Vector<ModelIndex> found_indices;
|
||||||
for (auto& child : node.m_children) {
|
for (auto& child : node.m_children) {
|
||||||
if (string_matches(child.name, searching, flags)) {
|
if (string_matches(child.name, searching, flags)) {
|
||||||
const_cast<Node&>(child).reify_if_needed();
|
const_cast<Node&>(child).reify_if_needed();
|
||||||
|
|
|
@ -132,7 +132,7 @@ public:
|
||||||
virtual bool is_editable(const ModelIndex&) const override;
|
virtual bool is_editable(const ModelIndex&) const override;
|
||||||
virtual bool is_searchable() const override { return true; }
|
virtual bool is_searchable() const override { return true; }
|
||||||
virtual void set_data(const ModelIndex&, const Variant&) 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 void invalidate() override;
|
virtual void invalidate() override;
|
||||||
|
|
||||||
static String timestamp_string(time_t timestamp)
|
static String timestamp_string(time_t timestamp)
|
||||||
|
|
|
@ -104,7 +104,7 @@ bool FilteringProxyModel::is_searchable() const
|
||||||
return m_model.is_searchable();
|
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);
|
auto found_indices = m_model.matches(searching, flags, index);
|
||||||
for (size_t i = 0; i < found_indices.size(); i++)
|
for (size_t i = 0; i < found_indices.size(); i++)
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
virtual void invalidate() override;
|
virtual void invalidate() override;
|
||||||
virtual ModelIndex index(int row, int column = 0, const ModelIndex& parent = ModelIndex()) const override;
|
virtual ModelIndex index(int row, int column = 0, const ModelIndex& parent = ModelIndex()) const override;
|
||||||
virtual bool is_searchable() 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);
|
void set_filter_term(const StringView& term);
|
||||||
|
|
||||||
|
|
|
@ -78,9 +78,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool is_searchable() const override { return true; }
|
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) {
|
if constexpr (IsTwoDimensional) {
|
||||||
for (auto it = m_data.begin(); it != m_data.end(); ++it) {
|
for (auto it = m_data.begin(); it != m_data.end(); ++it) {
|
||||||
for (auto it2d = (*it).begin(); it2d != (*it).end(); ++it2d) {
|
for (auto it2d = (*it).begin(); it2d != (*it).end(); ++it2d) {
|
||||||
|
|
|
@ -75,7 +75,7 @@ public:
|
||||||
virtual void set_data(const ModelIndex&, const Variant&) { }
|
virtual void set_data(const ModelIndex&, const Variant&) { }
|
||||||
virtual int tree_column() const { return 0; }
|
virtual int tree_column() const { return 0; }
|
||||||
virtual bool accepts_drag(const ModelIndex&, const Vector<String>& mime_types) const;
|
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 bool is_column_sortable([[maybe_unused]] int column_index) const { return true; }
|
||||||
virtual void sort([[maybe_unused]] int column, SortOrder) { }
|
virtual void sort([[maybe_unused]] int column, SortOrder) { }
|
||||||
|
|
|
@ -288,7 +288,7 @@ bool SortingProxyModel::is_searchable() const
|
||||||
return source().is_searchable();
|
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));
|
auto found_indices = source().matches(searching, flags, map_to_source(proxy_index));
|
||||||
for (size_t i = 0; i < found_indices.size(); i++)
|
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_editable(const ModelIndex&) const override;
|
||||||
virtual bool is_searchable() const override;
|
virtual bool is_searchable() const override;
|
||||||
virtual void set_data(const ModelIndex&, const Variant&) 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 accepts_drag(const ModelIndex&, const Vector<String>& mime_types) const override;
|
||||||
|
|
||||||
virtual bool is_column_sortable(int column_index) const override;
|
virtual bool is_column_sortable(int column_index) const override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue