Skip to content
Permalink
Browse files

Fix assert when viewing legacy user registration lists

This bug doesn't show up on release builds with QT4, I am not sure on
the effect on QT5 builds. When you connect a recent debug build to a
"legacy" server and view the user list, it will crash with the message:

ASSERT: "visual != -1" in file itemviews\qheaderview.cpp, line 1184

This is related to setting resize modes on columns that don't exist.
  • Loading branch information...
fwaggle authored and hacst committed Oct 26, 2014
1 parent 7fbd9d4 commit cde294f3a54944a0bdb8cc3f1cf4691cfdc9bc1c
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/mumble/UserEdit.cpp
@@ -66,12 +66,16 @@ UserEdit::UserEdit(const MumbleProto::UserList &userList, QWidget *parent)

#if QT_VERSION >= 0x050000
qtvUserList->header()->setSectionResizeMode(UserListModel::COL_NICK, QHeaderView::Stretch);
qtvUserList->header()->setSectionResizeMode(UserListModel::COL_INACTIVEDAYS, QHeaderView::ResizeToContents);
qtvUserList->header()->setSectionResizeMode(UserListModel::COL_LASTCHANNEL, QHeaderView::Stretch);
if (!m_model->isLegacy()) {
qtvUserList->header()->setSectionResizeMode(UserListModel::COL_INACTIVEDAYS, QHeaderView::ResizeToContents);
qtvUserList->header()->setSectionResizeMode(UserListModel::COL_LASTCHANNEL, QHeaderView::Stretch);
}
#else
qtvUserList->header()->setResizeMode(UserListModel::COL_NICK, QHeaderView::Stretch);
qtvUserList->header()->setResizeMode(UserListModel::COL_INACTIVEDAYS, QHeaderView::ResizeToContents);
qtvUserList->header()->setResizeMode(UserListModel::COL_LASTCHANNEL, QHeaderView::Stretch);
if (!m_model->isLegacy()) {
qtvUserList->header()->setResizeMode(UserListModel::COL_INACTIVEDAYS, QHeaderView::ResizeToContents);
qtvUserList->header()->setResizeMode(UserListModel::COL_LASTCHANNEL, QHeaderView::Stretch);
}
#endif

if (m_model->isLegacy()) {

0 comments on commit cde294f

Please sign in to comment.
You can’t perform that action at this time.