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);
|
circleWidget->search(searchString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Remove
|
||||||
bool FriendWidget::chatFormIsSet(bool focus) const
|
bool FriendWidget::chatFormIsSet(bool focus) const
|
||||||
{
|
{
|
||||||
Friend* f = FriendList::findFriend(friendId);
|
|
||||||
if (focus) {
|
if (focus) {
|
||||||
ContentDialog::focusFriend(friendId);
|
ContentDialog::focusFriend(friendId);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool exist = ContentDialog::friendWidgetExists(friendId);
|
return ContentDialog::friendWidgetExists(friendId);
|
||||||
return exist || f->getChatForm()->isVisible();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FriendWidget::setChatForm(ContentLayout* contentLayout)
|
void FriendWidget::setChatForm(ContentLayout* contentLayout)
|
||||||
|
|
|
@ -198,15 +198,14 @@ Group* GroupWidget::getGroup() const
|
||||||
return GroupList::findGroup(groupId);
|
return GroupList::findGroup(groupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Remove
|
||||||
bool GroupWidget::chatFormIsSet(bool focus) const
|
bool GroupWidget::chatFormIsSet(bool focus) const
|
||||||
{
|
{
|
||||||
Group* g = GroupList::findGroup(groupId);
|
|
||||||
if (focus) {
|
if (focus) {
|
||||||
ContentDialog::focusGroup(groupId);
|
ContentDialog::focusGroup(groupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool exist = ContentDialog::groupWidgetExists(groupId);
|
return ContentDialog::groupWidgetExists(groupId);
|
||||||
return exist || g->getChatForm()->isVisible();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupWidget::setChatForm(ContentLayout* contentLayout)
|
void GroupWidget::setChatForm(ContentLayout* contentLayout)
|
||||||
|
|
|
@ -1117,7 +1117,14 @@ void Widget::openDialog(GenericChatroomWidget* widget, bool newWindow)
|
||||||
widget->resetEventFlags();
|
widget->resetEventFlags();
|
||||||
widget->updateStatusLight();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user