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/contact_details/dialog.vala | 11 ++++------- main/src/ui/contact_details/muc_config_form_provider.vala | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) (limited to 'main/src/ui/contact_details') diff --git a/main/src/ui/contact_details/dialog.vala b/main/src/ui/contact_details/dialog.vala index 2f1fc81e..61044857 100644 --- a/main/src/ui/contact_details/dialog.vala +++ b/main/src/ui/contact_details/dialog.vala @@ -111,13 +111,10 @@ public class Dialog : Gtk.Dialog { row.add(widget); categories[category].add(list_row); - Idle.add(() => { - int pref_height, pref_width; - get_content_area().get_preferred_height(null, out pref_height); - get_preferred_width(out pref_width, null); - resize(pref_width, int.min(500, pref_height)); - return false; - }); + int pref_height, pref_width; + get_content_area().get_preferred_height(null, out pref_height); + get_preferred_width(out pref_width, null); + resize(pref_width, int.min(500, pref_height)); } private void add_category(string category) { diff --git a/main/src/ui/contact_details/muc_config_form_provider.vala b/main/src/ui/contact_details/muc_config_form_provider.vala index 47bbbe28..d4598265 100644 --- a/main/src/ui/contact_details/muc_config_form_provider.vala +++ b/main/src/ui/contact_details/muc_config_form_provider.vala @@ -21,13 +21,10 @@ public class MucConfigFormProvider : Plugins.ContactDetailsProvider, Object { if (stream == null) return; stream_interactor.get_module(MucManager.IDENTITY).get_config_form(conversation.account, conversation.counterpart, (jid, data_form) => { contact_details.save.connect(() => { data_form.submit(); }); - Idle.add(() => { - for (int i = 0; i < data_form.fields.size; i++) { - DataForms.DataForm.Field field = data_form.fields[i]; - add_field(field, contact_details); - } - return false; - }); + for (int i = 0; i < data_form.fields.size; i++) { + DataForms.DataForm.Field field = data_form.fields[i]; + add_field(field, contact_details); + } }); } } -- cgit v1.2.3-70-g09d2