mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor: Remove Friend::getChatForm using
This commit is contained in:
parent
a7e17a4ee4
commit
31d35ecc62
|
@ -363,15 +363,14 @@ void FriendWidget::search(const QString& searchString, bool hide)
|
|||
circleWidget->search(searchString);
|
||||
}
|
||||
|
||||
// TODO: Remove
|
||||
bool FriendWidget::chatFormIsSet(bool focus) const
|
||||
{
|
||||
Friend* f = FriendList::findFriend(friendId);
|
||||
if (focus) {
|
||||
ContentDialog::focusFriend(friendId);
|
||||
}
|
||||
|
||||
bool exist = ContentDialog::friendWidgetExists(friendId);
|
||||
return exist || f->getChatForm()->isVisible();
|
||||
return ContentDialog::friendWidgetExists(friendId);
|
||||
}
|
||||
|
||||
void FriendWidget::setChatForm(ContentLayout* contentLayout)
|
||||
|
|
|
@ -198,15 +198,14 @@ Group* GroupWidget::getGroup() const
|
|||
return GroupList::findGroup(groupId);
|
||||
}
|
||||
|
||||
// TODO: Remove
|
||||
bool GroupWidget::chatFormIsSet(bool focus) const
|
||||
{
|
||||
Group* g = GroupList::findGroup(groupId);
|
||||
if (focus) {
|
||||
ContentDialog::focusGroup(groupId);
|
||||
}
|
||||
|
||||
bool exist = ContentDialog::groupWidgetExists(groupId);
|
||||
return exist || g->getChatForm()->isVisible();
|
||||
return ContentDialog::groupWidgetExists(groupId);
|
||||
}
|
||||
|
||||
void GroupWidget::setChatForm(ContentLayout* contentLayout)
|
||||
|
|
|
@ -1117,7 +1117,14 @@ void Widget::openDialog(GenericChatroomWidget* widget, bool newWindow)
|
|||
widget->resetEventFlags();
|
||||
widget->updateStatusLight();
|
||||
|
||||
if (widget->chatFormIsSet(true) && !newWindow) {
|
||||
GenericChatForm* form;
|
||||
if (widget->getFriend()) {
|
||||
form = widget->getFriend()->getChatForm();
|
||||
} else {
|
||||
form = widget->getGroup()->getChatForm();
|
||||
}
|
||||
|
||||
if ((widget->chatFormIsSet(true) || form->isVisible()) && !newWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user