Fix updateMenuPermissions() after context menu change

This commit is contained in:
Benjamin Jemlich 2010-12-05 03:35:10 +01:00
parent 079f1ad219
commit be7ad39fd7

View File

@ -1686,8 +1686,19 @@ void MainWindow::on_qaChannelSendMessage_triggered() {
}
void MainWindow::updateMenuPermissions() {
ClientUser *cu = getContextMenuUser();
Channel *c = g.uiSession ? (cu ? cu->cChannel : getContextMenuChannel()) : NULL;
ClientUser *cu = NULL;
Channel *c = NULL;
if (g.uiSession) {
cu = getContextMenuUser();
if (!cu)
cu = pmModel->getUser(qtvUsers->currentIndex());
c = cu ? cu->cChannel : getContextMenuChannel();
if (!c)
c = pmModel->getChannel(qtvUsers->currentIndex());
}
ChanACL::Permissions p = static_cast<ChanACL::Permissions>(c ? c->uiPermissions : ChanACL::None);
if (c && ! p) {