mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-13 20:18:50 +03:00
remove SimpleIni as a dependency
use Glib::KeyFile instead which is basically the same file format also read into and save from struct once, cuz its faster and less redundant
This commit is contained in:
@@ -130,8 +130,7 @@ void GuildSettingsEmojisPane::AddEmojiRow(const EmojiData &emoji) {
|
||||
else
|
||||
row[m_columns.m_col_available] = "Yes";
|
||||
|
||||
static bool show_animations = Abaddon::Get().GetSettings().GetShowAnimations();
|
||||
if (show_animations && emoji.IsAnimated.has_value() && *emoji.IsAnimated) {
|
||||
if (Abaddon::Get().GetSettings().ShowAnimations && emoji.IsAnimated.has_value() && *emoji.IsAnimated) {
|
||||
const auto cb = [this, id = emoji.ID](const Glib::RefPtr<Gdk::PixbufAnimation> &pb) {
|
||||
for (auto &row : m_model->children()) {
|
||||
if (static_cast<Snowflake>(row[m_columns.m_col_id]) == id) {
|
||||
|
||||
@@ -81,7 +81,7 @@ GuildSettingsInfoPane::GuildSettingsInfoPane(Snowflake id)
|
||||
void GuildSettingsInfoPane::FetchGuildIcon(const GuildData &guild) {
|
||||
m_guild_icon.property_pixbuf() = Abaddon::Get().GetImageManager().GetPlaceholder(32);
|
||||
if (guild.HasIcon()) {
|
||||
if (Abaddon::Get().GetSettings().GetShowAnimations() && guild.HasAnimatedIcon()) {
|
||||
if (Abaddon::Get().GetSettings().ShowAnimations && guild.HasAnimatedIcon()) {
|
||||
auto cb = [this](const Glib::RefPtr<Gdk::PixbufAnimation> &pixbuf) {
|
||||
m_guild_icon.property_pixbuf_animation() = pixbuf;
|
||||
};
|
||||
|
||||
@@ -99,7 +99,7 @@ GuildSettingsMembersListItem::GuildSettingsMembersListItem(const GuildData &guil
|
||||
|
||||
auto &discord = Abaddon::Get().GetDiscordClient();
|
||||
|
||||
if (member.User->HasAnimatedAvatar() && Abaddon::Get().GetSettings().GetShowAnimations())
|
||||
if (member.User->HasAnimatedAvatar() && Abaddon::Get().GetSettings().ShowAnimations)
|
||||
m_avatar.SetURL(member.User->GetAvatarURL("gif", "32"));
|
||||
else
|
||||
m_avatar.SetURL(member.User->GetAvatarURL("png", "32"));
|
||||
@@ -113,8 +113,7 @@ GuildSettingsMembersListItem::GuildSettingsMembersListItem(const GuildData &guil
|
||||
discord.signal_guild_member_update().connect(sigc::track_obj(member_update_cb, *this));
|
||||
UpdateColor();
|
||||
|
||||
static bool crown = Abaddon::Get().GetSettings().GetShowOwnerCrown();
|
||||
if (crown && guild.OwnerID == member.User->ID) {
|
||||
if (Abaddon::Get().GetSettings().ShowOwnerCrown && guild.OwnerID == member.User->ID) {
|
||||
try {
|
||||
const static auto crown_path = Abaddon::GetResPath("/crown.png");
|
||||
auto pixbuf = Gdk::Pixbuf::create_from_file(crown_path, 12, 12);
|
||||
|
||||
Reference in New Issue
Block a user