1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

LibGUI: Add ModelClient abstract class and allow registering clients

This solves a problem where the SortingProxyModel doesn't
receive the on_update call because other code overwrote
the handler later on.
This commit is contained in:
Tom 2020-07-11 06:47:26 -06:00 committed by Andreas Kling
parent 0e10a92ebc
commit b778804d20
13 changed files with 144 additions and 60 deletions

View file

@ -34,7 +34,8 @@
#include <LibGUI/TableView.h>
#include <sys/stat.h>
class DirectoryView final : public GUI::StackWidget {
class DirectoryView final : public GUI::StackWidget
, private GUI::ModelClient {
C_OBJECT(DirectoryView)
public:
virtual ~DirectoryView() override;
@ -94,6 +95,8 @@ private:
DirectoryView();
const GUI::FileSystemModel& model() const { return *m_model; }
virtual void on_model_update(unsigned) override;
void handle_activation(const GUI::ModelIndex&);
void set_status_message(const StringView&);