From 3f531d6b91edab6c79fa232143db828bad13853c Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 11 Nov 2017 21:29:13 +0100 Subject: Read+(write) stream async --- main/src/ui/manage_accounts/account_row.vala | 14 ++++++-------- main/src/ui/manage_accounts/dialog.vala | 21 +++++++-------------- 2 files changed, 13 insertions(+), 22 deletions(-) (limited to 'main/src/ui/manage_accounts') diff --git a/main/src/ui/manage_accounts/account_row.vala b/main/src/ui/manage_accounts/account_row.vala index 911d48f4..8ac2c213 100644 --- a/main/src/ui/manage_accounts/account_row.vala +++ b/main/src/ui/manage_accounts/account_row.vala @@ -21,16 +21,14 @@ public class AccountRow : Gtk.ListBoxRow { jid_label.set_label(account.bare_jid.to_string()); stream_interactor.connection_manager.connection_error.connect((account, error) => { - Idle.add(() => { - if (account.equals(this.account)) update_warning_icon(); - return false; - }); + if (account.equals(this.account)) { + update_warning_icon(); + } }); stream_interactor.connection_manager.connection_state_changed.connect((account, state) => { - Idle.add(() => { - if (account.equals(this.account)) update_warning_icon(); - return false; - }); + if (account.equals(this.account)) { + update_warning_icon(); + } }); } diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala index 6fdce712..f82e90c0 100644 --- a/main/src/ui/manage_accounts/dialog.vala +++ b/main/src/ui/manage_accounts/dialog.vala @@ -84,23 +84,16 @@ public class Dialog : Gtk.Dialog { add_account(account); } - stream_interactor.get_module(AvatarManager.IDENTITY).received_avatar.connect((pixbuf, jid, account) => { - Idle.add(() => { - on_received_avatar(pixbuf, jid, account); - return false; - }); - }); + stream_interactor.get_module(AvatarManager.IDENTITY).received_avatar.connect(on_received_avatar); stream_interactor.connection_manager.connection_error.connect((account, error) => { - Idle.add(() => { - if (account.equals(selected_account)) update_status_label(account); - return false; - }); + if (account.equals(selected_account)) { + update_status_label(account); + } }); stream_interactor.connection_manager.connection_state_changed.connect((account, state) => { - Idle.add(() => { - if (account.equals(selected_account)) update_status_label(account); - return false; - }); + if (account.equals(selected_account)) { + update_status_label(account); + } }); if (account_list.get_row_at_index(0) != null) account_list.select_row(account_list.get_row_at_index(0)); -- cgit v1.2.3-70-g09d2