[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [ruqola] src: Fix warning
From:       Montel Laurent <null () kde ! org>
Date:       2017-08-31 21:29:50
Message-ID: E1dnX26-000696-OD () code ! kde ! org
[Download RAW message or body]

Git commit cd180274448c87c2b29d26bcdd0bab8d84927c68 by Montel Laurent.
Committed on 31/08/2017 at 21:29.
Pushed by mlaurent into branch 'master'.

Fix warning

M  +6    -6    src/qml/Desktop.qml
M  +1    -1    src/usermodel.cpp

https://commits.kde.org/ruqola/cd180274448c87c2b29d26bcdd0bab8d84927c68

diff --git a/src/qml/Desktop.qml b/src/qml/Desktop.qml
index 5104e44..1fe28d2 100644
--- a/src/qml/Desktop.qml
+++ b/src/qml/Desktop.qml
@@ -189,13 +189,13 @@ Kirigami.ApplicationWindow {
                     ToolButton {
                         iconName: "favorite"
                         checkable: true
-                        checked: appid.selectedRoom.favorite
+                        checked: appid.selectedRoom && appid.selectedRoom.favorite
                         onCheckedChanged: {
                             console.log("checked favorite" + checked)
                         }
                     }                    
                     Kirigami.Heading {
-                        text: "#" +appid.selectedRoom.name
+                        text: "#" + (appid.selectedRoom ? appid.selectedRoom.name : "")
                         level: 3
                         font.bold: true
                     }
@@ -205,8 +205,8 @@ Kirigami.ApplicationWindow {
                 }
 
                 Kirigami.Label {
-                    visible: appid.selectedRoom.topic !== ""
-                    text: appid.selectedRoom.topic
+                    visible: appid.selectedRoom && (appid.selectedRoom.topic !== "")
+                    text: appid.selectedRoom ? appid.selectedRoom.topic : ""
                     font.italic: true
                     anchors.right: parent.right
                     anchors.left: parent.left
@@ -214,8 +214,8 @@ Kirigami.ApplicationWindow {
                     wrapMode: Label.Wrap
                 }
                 Kirigami.Label {
-                    visible: appid.selectedRoom.announcement !== ""
-                    text: appid.selectedRoom.announcement
+                    visible: appid.selectedRoom && (appid.selectedRoom.announcement !== "")
+                    text: appid.selectedRoom ? appid.selectedRoom.announcement : ""
                     anchors.right: parent.right
                     anchors.left: parent.left
                     anchors.margins: 2*Kirigami.Units.smallSpacing
diff --git a/src/usermodel.cpp b/src/usermodel.cpp
index 631ded5..1387497 100644
--- a/src/usermodel.cpp
+++ b/src/usermodel.cpp
@@ -87,7 +87,7 @@ void UsersModel::removeUser(const QString &userId)
 
 void UsersModel::addUser(User *user)
 {
-    qCDebug(RUQOLA_LOG) << " User added " << user;
+    qCDebug(RUQOLA_LOG) << " User added " << *user;
     //TODO verify if duplicate ?
     int pos = mUsers.size();
     qDebug() << "addUser mUsers before"<<mUsers.count();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic