Fix most compilation warnings

This commit is contained in:
Tobias Fella
2023-07-15 16:57:06 +02:00
parent b990e3fbcb
commit 32ff22ba89
11 changed files with 95 additions and 134 deletions

View File

@@ -78,8 +78,11 @@ QVariant UserListModel::data(const QModelIndex &index, int role) const
return QVariant::fromValue(user);
}
if (role == PowerLevelRole) {
auto pl = m_currentRoom->getCurrentState<RoomPowerLevelsEvent>();
return pl->powerLevelForUser(user->id());
auto plEvent = m_currentRoom->currentState().get<RoomPowerLevelsEvent>();
if (!plEvent) {
return 0;
}
return plEvent->powerLevelForUser(user->id());
}
if (role == PowerLevelStringRole) {
auto pl = m_currentRoom->currentState().get<RoomPowerLevelsEvent>();