1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

LibGUI: Make GTableModel a retainable object.

It became clear that this class needs to support multiple owners.
This commit is contained in:
Andreas Kling 2019-03-20 03:27:07 +01:00
parent 41c744b3c8
commit f47945759b
22 changed files with 44 additions and 34 deletions

View file

@ -8,7 +8,7 @@ class IRCChannel;
class IRCChannelMemberListModel final : public GTableModel {
public:
enum Column { Name };
explicit IRCChannelMemberListModel(IRCChannel&);
static Retained<IRCChannelMemberListModel> create(IRCChannel& channel) { return adopt(*new IRCChannelMemberListModel(channel)); }
virtual ~IRCChannelMemberListModel() override;
virtual int row_count() const override;
@ -22,5 +22,7 @@ public:
Function<void(const String&)> on_activation;
private:
explicit IRCChannelMemberListModel(IRCChannel&);
IRCChannel& m_channel;
};