summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-20 19:45:08 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-20 19:45:08 +0200
commit076827a05d731b07e2392aaf0f86761c38eb00eb (patch)
tree908600e8c3fe7ae316964b3348f343ed1cd6f68f /Libraries
parentf7dce05c82d0826c8ed2373ca25e3ee14c5a3065 (diff)
downloadserenity-076827a05d731b07e2392aaf0f86761c38eb00eb.zip
GModel: Rename on_model_update(GModel&) => on_update()
Just simplifying the API of this hook a little bit.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/GModel.cpp4
-rw-r--r--Libraries/LibGUI/GModel.h2
-rw-r--r--Libraries/LibGUI/GSortingProxyModel.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/Libraries/LibGUI/GModel.cpp b/Libraries/LibGUI/GModel.cpp
index 36e35abd56..e6cbc03af9 100644
--- a/Libraries/LibGUI/GModel.cpp
+++ b/Libraries/LibGUI/GModel.cpp
@@ -27,8 +27,8 @@ void GModel::for_each_view(Function<void(GAbstractView&)> callback)
void GModel::did_update()
{
- if (on_model_update)
- on_model_update(*this);
+ if (on_update)
+ on_update();
for_each_view([](auto& view) {
view.did_update_model();
});
diff --git a/Libraries/LibGUI/GModel.h b/Libraries/LibGUI/GModel.h
index e41c2e50ea..5d714c85b4 100644
--- a/Libraries/LibGUI/GModel.h
+++ b/Libraries/LibGUI/GModel.h
@@ -67,7 +67,7 @@ public:
void register_view(Badge<GAbstractView>, GAbstractView&);
void unregister_view(Badge<GAbstractView>, GAbstractView&);
- Function<void(GModel&)> on_model_update;
+ Function<void()> on_update;
Function<void(const GModelIndex&)> on_selection_changed;
protected:
diff --git a/Libraries/LibGUI/GSortingProxyModel.cpp b/Libraries/LibGUI/GSortingProxyModel.cpp
index 0876f960d9..17859a4c2b 100644
--- a/Libraries/LibGUI/GSortingProxyModel.cpp
+++ b/Libraries/LibGUI/GSortingProxyModel.cpp
@@ -7,7 +7,7 @@ GSortingProxyModel::GSortingProxyModel(NonnullRefPtr<GModel>&& target)
: m_target(move(target))
, m_key_column(-1)
{
- m_target->on_model_update = [this](GModel&) {
+ m_target->on_update = [this] {
resort();
};
}