[network/ruqola] src/widgets/channellist: Minor optimization
Laurent Montel <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 082de08e5324cab7129777ed96dfe7d5280ff7e6 by Laurent Montel.
Committed on 30/07/2026 at 06:29.
Pushed by mlaurent into branch 'master'.
Minor optimization
M +8 -6 src/widgets/channellist/channellistview.cpp
https://invent.kde.org/network/ruqola/-/commit/082de08e5324cab7129777ed96dfe7d5280ff7e6
diff --git a/src/widgets/channellist/channellistview.cpp b/src/widgets/channellist/channellistview.cpp
index 4f4e215a9f..c6c06714a9 100644
--- a/src/widgets/channellist/channellistview.cpp
+++ b/src/widgets/channellist/channellistview.cpp
@@ -368,18 +368,20 @@ void ChannelListView::slotMarkAsChannel(const QModelIndex &index, bool markAsRea
void ChannelListView::channelSelected(const QModelIndex &index)
{
- if (!index.parent().isValid())
+ if (!index.parent().isValid()) {
return;
+ }
const QByteArray roomId = index.data(RoomModel::RoomId).toByteArray();
const QString roomName = index.data(RoomModel::RoomFName).toString();
const auto roomType = index.data(RoomModel::RoomType).value<Room::RoomType>();
const auto avatarInfo = index.data(RoomModel::RoomAvatarInfo).value<Utils::AvatarInfo>();
- ChannelSelectedInfo info;
- info.avatarInfo = avatarInfo;
- info.roomId = roomId;
- info.roomName = roomName;
- info.roomType = roomType;
+ const ChannelSelectedInfo info{
+ .roomId = roomId,
+ .roomName = roomName,
+ .roomType = roomType,
+ .avatarInfo = avatarInfo,
+ };
Q_EMIT roomSelected(info);
}