mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
prevent segfault ;_; repaint only after changing alias
This commit is contained in:
parent
b489e7f712
commit
1abef6c0c6
|
@ -51,7 +51,7 @@ void GroupWidget::contextMenuEvent(QContextMenuEvent * event)
|
||||||
{
|
{
|
||||||
QPoint pos = event->globalPos();
|
QPoint pos = event->globalPos();
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QAction* setAlias = menu.addAction(tr("Set title..."));
|
QAction* setTitle = menu.addAction(tr("Set title..."));
|
||||||
QAction* quitGroup = menu.addAction(tr("Quit group","Menu to quit a groupchat"));
|
QAction* quitGroup = menu.addAction(tr("Quit group","Menu to quit a groupchat"));
|
||||||
|
|
||||||
QAction* selectedItem = menu.exec(pos);
|
QAction* selectedItem = menu.exec(pos);
|
||||||
|
@ -59,7 +59,7 @@ void GroupWidget::contextMenuEvent(QContextMenuEvent * event)
|
||||||
{
|
{
|
||||||
if (selectedItem == quitGroup)
|
if (selectedItem == quitGroup)
|
||||||
emit removeGroup(groupId);
|
emit removeGroup(groupId);
|
||||||
else if (selectedItem == setAlias)
|
else if (selectedItem == setTitle)
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
Group* g = GroupList::findGroup(groupId);
|
Group* g = GroupList::findGroup(groupId);
|
||||||
|
@ -69,9 +69,9 @@ void GroupWidget::contextMenuEvent(QContextMenuEvent * event)
|
||||||
|
|
||||||
if (ok && alias != nameLabel->fullText())
|
if (ok && alias != nameLabel->fullText())
|
||||||
emit g->getChatForm()->groupTitleChanged(groupId, alias.left(128));
|
emit g->getChatForm()->groupTitleChanged(groupId, alias.left(128));
|
||||||
}
|
|
||||||
}
|
|
||||||
this->repaint();
|
this->repaint();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupWidget::onUserListChanged()
|
void GroupWidget::onUserListChanged()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user