diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-13 16:04:17 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-13 20:18:11 +0200 |
commit | fe19cf0ff2b04b5f442706a96aa6974488c9cd6c (patch) | |
tree | ef1ec6371b07b65717d33d8f8cfcf559ced42346 | |
parent | 82e949aa7cc5d2b357080afeb85bdc3c885f61cb (diff) | |
download | serenity-fe19cf0ff2b04b5f442706a96aa6974488c9cd6c.zip |
LibGUI: Move Model::index() out of line
-rw-r--r-- | Libraries/LibGUI/Model.cpp | 5 | ||||
-rw-r--r-- | Libraries/LibGUI/Model.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibGUI/Model.cpp b/Libraries/LibGUI/Model.cpp index 68a78539d8..6ed496e551 100644 --- a/Libraries/LibGUI/Model.cpp +++ b/Libraries/LibGUI/Model.cpp @@ -68,6 +68,11 @@ ModelIndex Model::create_index(int row, int column, const void* data) const return ModelIndex(*this, row, column, const_cast<void*>(data)); } +ModelIndex Model::index(int row, int column, const ModelIndex&) const +{ + return create_index(row, column); +} + ModelIndex Model::sibling(int row, int column, const ModelIndex& parent) const { if (!parent.is_valid()) diff --git a/Libraries/LibGUI/Model.h b/Libraries/LibGUI/Model.h index d12a0f2afc..c9404dc46a 100644 --- a/Libraries/LibGUI/Model.h +++ b/Libraries/LibGUI/Model.h @@ -80,7 +80,7 @@ public: virtual TriState data_matches(const ModelIndex&, Variant) const { return TriState::Unknown; } virtual void update() = 0; virtual ModelIndex parent_index(const ModelIndex&) const { return {}; } - virtual ModelIndex index(int row, int column = 0, const ModelIndex& = ModelIndex()) const { return create_index(row, column); } + virtual ModelIndex index(int row, int column = 0, const ModelIndex& parent = ModelIndex()) const; virtual ModelIndex sibling(int row, int column, const ModelIndex& parent) const; virtual bool is_editable(const ModelIndex&) const { return false; } virtual void set_data(const ModelIndex&, const Variant&) { } |