[network/ruqola] src/widgets/dialogs: Minor optimization

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit f599b2fe565fae63b03e3e8ed8933bd95c0eedcd by Laurent Montel.
Committed on 29/07/2026 at 11:21.
Pushed by mlaurent into branch 'master'.

Minor optimization

M  +5    -1    src/widgets/dialogs/channelrolesinfowidget.cpp

https://invent.kde.org/network/ruqola/-/commit/f599b2fe565fae63b03e3e8ed8933bd95c0eedcd

diff --git a/src/widgets/dialogs/channelrolesinfowidget.cpp b/src/widgets/dialogs/channelrolesinfowidget.cpp
index bfa884c172..94ab5f7d4c 100644
--- a/src/widgets/dialogs/channelrolesinfowidget.cpp
+++ b/src/widgets/dialogs/channelrolesinfowidget.cpp
@@ -54,16 +54,20 @@ void ChannelRolesInfoWidget::setRoom(Room *room)
                 listLeaders.append(role.userName());
             }
         }
+        bool showWidget = false;
         if (!listOwners.isEmpty()) {
+            showWidget = true;
             generateInfo(i18np("Owner:", "Owners:", listOwners.count()), listOwners);
         }
         if (!listModerators.isEmpty()) {
+            showWidget = true;
             generateInfo(i18np("Moderator:", "Moderators:", listModerators.count()), listModerators);
         }
         if (!listLeaders.isEmpty()) {
+            showWidget = true;
             generateInfo(i18np("Leader:", "Leaders:", listLeaders.count()), listLeaders);
         }
-        if (!listOwners.isEmpty() || !listModerators.isEmpty() || !listLeaders.isEmpty()) {
+        if (showWidget) {
             show();
         } else {
             hide();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.