From 902c96ee53db6d5cbe2c21c9424c89e1e0088cb1 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Mon, 7 Sep 2020 00:27:41 -0400 Subject: use a singleton (oh no) instead of passing Abaddon* everywhere --- components/memberlist.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'components/memberlist.cpp') diff --git a/components/memberlist.cpp b/components/memberlist.cpp index 678ae69..61f5791 100644 --- a/components/memberlist.cpp +++ b/components/memberlist.cpp @@ -32,7 +32,7 @@ Gtk::Widget *MemberList::GetRoot() const { void MemberList::SetActiveChannel(Snowflake id) { std::scoped_lock guard(m_mutex); m_chan_id = id; - m_guild_id = m_abaddon->GetDiscordClient().GetChannel(id)->GuildID; + m_guild_id = Abaddon::Get().GetDiscordClient().GetChannel(id)->GuildID; } void MemberList::UpdateMemberList() { @@ -50,7 +50,7 @@ void MemberList::UpdateMemberListInternal() { if (!m_chan_id.IsValid()) return; - auto &discord = m_abaddon->GetDiscordClient(); + auto &discord = Abaddon::Get().GetDiscordClient(); auto *chan = discord.GetChannel(m_chan_id); std::unordered_set ids; if (chan->Type == ChannelType::DM || chan->Type == ChannelType::GROUP_DM) { @@ -165,7 +165,7 @@ void MemberList::on_copy_id_activate() { void MemberList::on_insert_mention_activate() { auto *row = dynamic_cast(m_row_menu_target); if (row == nullptr) return; - m_abaddon->ActionInsertMention(row->ID); + Abaddon::Get().ActionInsertMention(row->ID); } void MemberList::AttachUserMenuHandler(Gtk::ListBoxRow *row, Snowflake id) { @@ -179,7 +179,3 @@ void MemberList::AttachUserMenuHandler(Gtk::ListBoxRow *row, Snowflake id) { return false; }); } - -void MemberList::SetAbaddon(Abaddon *ptr) { - m_abaddon = ptr; -} -- cgit v1.2.3