From 7b4118a1a37f94af20fdc02234fd155b9c170f88 Mon Sep 17 00:00:00 2001 From: Diadlo Date: Wed, 13 Apr 2016 23:02:26 +0300 Subject: [PATCH] refactor(groupinviteform): Deleting made clearer --- src/widget/form/groupinviteform.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/widget/form/groupinviteform.cpp b/src/widget/form/groupinviteform.cpp index 7d483e69e..871a10833 100644 --- a/src/widget/form/groupinviteform.cpp +++ b/src/widget/form/groupinviteform.cpp @@ -160,16 +160,9 @@ void GroupInviteForm::deleteInviteButtons(QWidget* widget) { QList buttons = widget->findChildren(); - if (acceptButtons.contains(buttons.at(0))) - { - acceptButtons.remove(buttons.at(0)); - rejectButtons.remove(buttons.at(1)); - } - else - { - acceptButtons.remove(buttons.at(1)); - rejectButtons.remove(buttons.at(0)); - } + QSet set = QSet::fromList(buttons); + acceptButtons.subtract(set); + rejectButtons.subtract(set); QList labels = widget->findChildren(); groupLabels.remove(labels.at(0));