diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-10-16 21:35:44 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-10-16 21:35:44 -0400 |
commit | 4906775edeb96dc3f9194d43252ab2b47bc11e4e (patch) | |
tree | 3083480a4e2d3d694e4ae9408f2f602d35092765 /src/components | |
parent | 2646da31a1a396b5c9d4c9537a5f04f8a210883c (diff) | |
download | abaddon-portaudio-4906775edeb96dc3f9194d43252ab2b47bc11e4e.tar.gz abaddon-portaudio-4906775edeb96dc3f9194d43252ab2b47bc11e4e.zip |
remove tmp row map from channel list
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/channellist/channellist.cpp | 11 | ||||
-rw-r--r-- | src/components/channellist/channellist.hpp | 5 |
2 files changed, 3 insertions, 13 deletions
diff --git a/src/components/channellist/channellist.cpp b/src/components/channellist/channellist.cpp index 236513e..ca731c9 100644 --- a/src/components/channellist/channellist.cpp +++ b/src/components/channellist/channellist.cpp @@ -628,7 +628,6 @@ void ChannelList::SetActiveChannel(Snowflake id, bool expand_to) { } void ChannelList::UseExpansionState(const ExpansionStateRoot &root) { - m_tmp_row_map.clear(); } ExpansionStateRoot ChannelList::GetExpansionState() const { @@ -650,7 +649,6 @@ Gtk::TreeModel::iterator ChannelList::AddFolder(const UserSettingsGuildFoldersEn auto folder_row = *m_model->append(); folder_row[m_columns.m_type] = RenderType::Folder; folder_row[m_columns.m_id] = *folder.ID; - m_tmp_row_map[*folder.ID] = folder_row; if (folder.Name.has_value()) { folder_row[m_columns.m_name] = Glib::Markup::escape_text(*folder.Name); } else { @@ -684,7 +682,6 @@ Gtk::TreeModel::iterator ChannelList::AddGuild(const GuildData &guild, const Gtk guild_row[m_columns.m_id] = guild.ID; guild_row[m_columns.m_name] = "<b>" + Glib::Markup::escape_text(guild.Name) + "</b>"; guild_row[m_columns.m_icon] = img.GetPlaceholder(GuildIconSize); - m_tmp_guild_row_map[guild.ID] = guild_row; if (Abaddon::Get().GetSettings().ShowAnimations && guild.HasAnimatedIcon()) { const auto cb = [this, id = guild.ID](const Glib::RefPtr<Gdk::PixbufAnimation> &pb) { @@ -735,8 +732,9 @@ Gtk::TreeModel::iterator ChannelList::AddGuild(const GuildData &guild, const Gtk const auto it = threads.find(channel.ID); if (it == threads.end()) return; - for (const auto &thread : it->second) - m_tmp_row_map[thread.ID] = CreateThreadRow(row.children(), thread); + for (const auto &thread : it->second) { + CreateThreadRow(row.children(), thread); + } }; #ifdef WITH_VOICE @@ -766,7 +764,6 @@ Gtk::TreeModel::iterator ChannelList::AddGuild(const GuildData &guild, const Gtk channel_row[m_columns.m_sort] = *channel.Position + OrphanChannelSortOffset; channel_row[m_columns.m_nsfw] = channel.NSFW(); add_threads(channel, channel_row); - m_tmp_row_map[channel.ID] = channel_row; } for (const auto &[category_id, channels] : categories) { @@ -778,7 +775,6 @@ Gtk::TreeModel::iterator ChannelList::AddGuild(const GuildData &guild, const Gtk cat_row[m_columns.m_name] = Glib::Markup::escape_text(*category->Name); cat_row[m_columns.m_sort] = *category->Position; cat_row[m_columns.m_expanded] = true; - m_tmp_row_map[category_id] = cat_row; // m_view.expand_row wont work because it might not have channels for (const auto &channel : channels) { @@ -798,7 +794,6 @@ Gtk::TreeModel::iterator ChannelList::AddGuild(const GuildData &guild, const Gtk channel_row[m_columns.m_sort] = *channel.Position; channel_row[m_columns.m_nsfw] = channel.NSFW(); add_threads(channel, channel_row); - m_tmp_row_map[channel.ID] = channel_row; } } diff --git a/src/components/channellist/channellist.hpp b/src/components/channellist/channellist.hpp index df7dbac..8c644c9 100644 --- a/src/components/channellist/channellist.hpp +++ b/src/components/channellist/channellist.hpp @@ -188,11 +188,6 @@ protected: Snowflake m_active_channel; - // (GetIteratorForChannelFromID is rather slow) - // only temporary since i dont want to worry about maintaining this map - std::unordered_map<Snowflake, Gtk::TreeModel::iterator> m_tmp_row_map; - std::unordered_map<Snowflake, Gtk::TreeModel::iterator> m_tmp_guild_row_map; - public: using type_signal_action_channel_item_select = sigc::signal<void, Snowflake>; using type_signal_action_guild_leave = sigc::signal<void, Snowflake>; |