From aa9a10fa8bac48fe570d7ea0f1ca66b08d73813d Mon Sep 17 00:00:00 2001 From: TheSpiritXIII Date: Fri, 17 Jul 2015 10:12:00 -0400 Subject: [PATCH] Multiwindow: Fix segfault on quiting groups, remove dead code --- src/widget/contentdialog.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/widget/contentdialog.cpp b/src/widget/contentdialog.cpp index 80175d728..39dd275e9 100644 --- a/src/widget/contentdialog.cpp +++ b/src/widget/contentdialog.cpp @@ -346,23 +346,14 @@ void ContentDialog::cycleContacts(bool forward, bool loop) } else if (index >= currentLayout->count()) { - /*if (!loop && currentLayout == friendLayout->getLayoutOffline()) - { - forward = !forward; // Go backward. - index += forward ? 2 : -2; // Go back to where started and then one. - continue; // Recheck bounds. - } - else*/ - { - currentLayout = nextLayout(currentLayout, forward); - index = 0; - } + currentLayout = nextLayout(currentLayout, forward); + index = 0; continue; } GenericChatroomWidget* chatWidget = dynamic_cast(currentLayout->itemAt(index)->widget()); - if (chatWidget != nullptr) + if (chatWidget != nullptr && chatWidget != activeChatroomWidget) onChatroomWidgetClicked(chatWidget, false); return;