From 9ec02e0fce994a2630d0b0ffa3ce0976f7749290 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Sun, 18 Nov 2018 14:29:09 +0800 Subject: [PATCH] Magically reduce memory use. --- imports/Spectral/Panel/RoomListPanel.qml | 2 +- src/spectralroom.h | 4 ++-- src/spectraluser.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/imports/Spectral/Panel/RoomListPanel.qml b/imports/Spectral/Panel/RoomListPanel.qml index c35beb9..f9ce1cf 100644 --- a/imports/Spectral/Panel/RoomListPanel.qml +++ b/imports/Spectral/Panel/RoomListPanel.qml @@ -710,7 +710,7 @@ Rectangle { Rectangle { anchors.fill: parent - visible: highlightCount > 0 || currentRoom === enteredRoom + visible: currentRoom === enteredRoom color: Material.accent opacity: 0.1 } diff --git a/src/spectralroom.h b/src/spectralroom.h index ebb736e..14866c0 100644 --- a/src/spectralroom.h +++ b/src/spectralroom.h @@ -19,11 +19,11 @@ class RoomPaintable : public Paintable { } QImage image(int dimension) override { - if (!m_room) return QImage(); + if (!m_room) return {}; return m_room->avatar(dimension); } QImage image(int width, int height) override { - if (!m_room) return QImage(); + if (!m_room) return {}; return m_room->avatar(width, height); } diff --git a/src/spectraluser.h b/src/spectraluser.h index 11a81d4..4fe459e 100644 --- a/src/spectraluser.h +++ b/src/spectraluser.h @@ -16,11 +16,11 @@ class UserPaintable : public Paintable { UserPaintable(User* parent) : Paintable(parent), m_user(parent) {} QImage image(int dimension) override { - if (!m_user) return QImage(); + if (!m_user) return {}; return m_user->avatar(dimension); } QImage image(int width, int height) override { - if (!m_user) return QImage(); + if (!m_user) return {}; return m_user->avatar(width, height); }