From 872b15e6af603d166f5a1df4c960fb69b2c7938b Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Wed, 30 Sep 2020 15:12:52 -0400 Subject: hopefully take care of some annoying bugs --- components/channels.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'components/channels.cpp') diff --git a/components/channels.cpp b/components/channels.cpp index dffd200..cb5307b 100644 --- a/components/channels.cpp +++ b/components/channels.cpp @@ -46,13 +46,7 @@ ChannelListRowDMChannel::ChannelListRowDMChannel(const Channel *data) { m_icon = Gtk::manage(new Gtk::Image(buf)); else { m_icon = Gtk::manage(new Gtk::Image(Abaddon::Get().GetImageManager().GetPlaceholder(24))); - Abaddon::Get().GetImageManager().LoadFromURL(data->Recipients[0].GetAvatarURL("png", "16"), [this](Glib::RefPtr ldbuf) { - Glib::signal_idle().connect([this, ldbuf]() -> bool { - m_icon->property_pixbuf() = ldbuf; - - return false; - }); - }); + Abaddon::Get().GetImageManager().LoadFromURL(data->Recipients[0].GetAvatarURL("png", "16"), sigc::mem_fun(*this, &ChannelListRowDMChannel::OnImageLoad)); } } @@ -70,6 +64,11 @@ ChannelListRowDMChannel::ChannelListRowDMChannel(const Channel *data) { show_all_children(); } +void ChannelListRowDMChannel::OnImageLoad(Glib::RefPtr buf) { + if (m_icon != nullptr) + m_icon->property_pixbuf() = buf; +} + ChannelListRowGuild::ChannelListRowGuild(const Guild *data) { ID = data->ID; m_ev = Gtk::manage(new Gtk::EventBox); -- cgit v1.2.3