From a486d8d7fc567c191e7259b478b6f03b3800ac4a Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 20 Jun 2024 21:35:55 +0200 Subject: Fix tray icon badge count not getting updated since 838b091acd07b681fc52f6f705b2bee8ce8519d5 --- src/TrayIcon.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/TrayIcon.h') diff --git a/src/TrayIcon.h b/src/TrayIcon.h index f2009612..7c0bc7b2 100644 --- a/src/TrayIcon.h +++ b/src/TrayIcon.h @@ -15,15 +15,11 @@ class QPainter; class MsgCountComposedIcon final : public QIconEngine { public: - MsgCountComposedIcon(const QString &filename); + MsgCountComposedIcon(const QIcon &icon); void paint(QPainter *p, const QRect &rect, QIcon::Mode mode, QIcon::State state) override; QIconEngine *clone() const override; - QList availableSizes(QIcon::Mode mode, QIcon::State state) -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - const -#endif - override; + QList availableSizes(QIcon::Mode mode, QIcon::State state) override; QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override; int msgCount = 0; @@ -47,7 +43,6 @@ private: QAction *viewAction_; QAction *quitAction_; -#if !defined(Q_OS_MACOS) && !defined(Q_OS_WIN) - MsgCountComposedIcon *icon_; -#endif + int previousCount = 0; + QIcon icon; }; -- cgit 1.5.1