summaryrefslogtreecommitdiff
path: root/components/channels.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-11-18 01:03:35 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2021-11-18 01:03:35 -0500
commit9c285a09e50ce9d4b786c9f28402e94a9f4fb418 (patch)
tree78701d71461b48e3f8083b45b1f420362950ef0a /components/channels.cpp
parent1f68da6b77c82f462472385a8e31a578c4c5caed (diff)
parent9d21df8e1bca9ccfa1bcfcde3bc8f35473866166 (diff)
downloadabaddon-portaudio-9c285a09e50ce9d4b786c9f28402e94a9f4fb418.tar.gz
abaddon-portaudio-9c285a09e50ce9d4b786c9f28402e94a9f4fb418.zip
Merge branch 'master' of https://github.com/uowuo/abaddon into msys
Diffstat (limited to 'components/channels.cpp')
-rw-r--r--components/channels.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/components/channels.cpp b/components/channels.cpp
index 621d7dc..b4769d9 100644
--- a/components/channels.cpp
+++ b/components/channels.cpp
@@ -16,8 +16,8 @@ ChannelList::ChannelList()
, m_menu_guild_leave("_Leave", true)
, m_menu_category_copy_id("_Copy ID", true)
, m_menu_channel_copy_id("_Copy ID", true)
- , m_menu_dm_close("") // changes depending on if group or not
, m_menu_dm_copy_id("_Copy ID", true)
+ , m_menu_dm_close("") // changes depending on if group or not
, m_menu_thread_copy_id("_Copy ID", true)
, m_menu_thread_leave("_Leave", true)
, m_menu_thread_archive("_Archive", true)
@@ -167,7 +167,6 @@ void ChannelList::UpdateListing() {
m_model->clear();
auto &discord = Abaddon::Get().GetDiscordClient();
- auto &img = Abaddon::Get().GetImageManager();
const auto guild_ids = discord.GetUserSortedGuilds();
int sortnum = 0;
@@ -185,10 +184,7 @@ void ChannelList::UpdateListing() {
}
void ChannelList::UpdateNewGuild(const GuildData &guild) {
- auto &img = Abaddon::Get().GetImageManager();
-
- auto iter = AddGuild(guild);
-
+ AddGuild(guild);
// update sort order
int sortnum = 0;
for (const auto guild_id : Abaddon::Get().GetDiscordClient().GetUserSortedGuilds()) {
@@ -561,7 +557,7 @@ void ChannelList::UpdateChannelCategory(const ChannelData &channel) {
}
Gtk::TreeModel::iterator ChannelList::GetIteratorForGuildFromID(Snowflake id) {
- for (const auto child : m_model->children()) {
+ for (const auto &child : m_model->children()) {
if (child[m_columns.m_id] == id)
return child;
}
@@ -570,14 +566,14 @@ Gtk::TreeModel::iterator ChannelList::GetIteratorForGuildFromID(Snowflake id) {
Gtk::TreeModel::iterator ChannelList::GetIteratorForChannelFromID(Snowflake id) {
std::queue<Gtk::TreeModel::iterator> queue;
- for (const auto child : m_model->children())
- for (const auto child2 : child.children())
+ for (const auto &child : m_model->children())
+ for (const auto &child2 : child.children())
queue.push(child2);
while (!queue.empty()) {
auto item = queue.front();
if ((*item)[m_columns.m_id] == id) return item;
- for (const auto child : item->children())
+ for (const auto &child : item->children())
queue.push(child);
queue.pop();
}
@@ -1052,9 +1048,6 @@ void CellRendererChannels::get_preferred_height_for_width_vfunc_category(Gtk::Wi
}
void CellRendererChannels::render_vfunc_category(const Cairo::RefPtr<Cairo::Context> &cr, Gtk::Widget &widget, const Gdk::Rectangle &background_area, const Gdk::Rectangle &cell_area, Gtk::CellRendererState flags) {
- int available_xpad = background_area.get_width();
- int available_ypad = background_area.get_height();
-
// todo: figure out how Gtk::Arrow is rendered because i like it better :^)
constexpr static int len = 5;
int x1, y1, x2, y2, x3, y3;