From 7e9636903f944ee9c772f9fb3def9ca63150c23f Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Mon, 8 Apr 2024 11:56:59 +0200 Subject: [PATCH] fix some of the qml issues Signed-off-by: Matthieu Gallien --- src/gui/systray.cpp | 2 ++ src/gui/systray.h | 6 ++++-- src/gui/tray/Window.qml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index fb8451aa4c7b8..fec2202ef87e9 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -115,6 +115,8 @@ void Systray::create() if (_trayEngine) { if (!AccountManager::instance()->accounts().isEmpty()) { _trayEngine->rootContext()->setContextProperty("activityModel", UserModel::instance()->currentActivityModel()); + } else { + _trayEngine->rootContext()->setContextProperty("activityModel", &_fakeActivityModel); } QQmlComponent trayWindowComponent(trayEngine(), QStringLiteral("qrc:/qml/src/gui/tray/Window.qml")); diff --git a/src/gui/systray.h b/src/gui/systray.h index 5a450580841a9..8a65c45e4d424 100644 --- a/src/gui/systray.h +++ b/src/gui/systray.h @@ -15,12 +15,12 @@ #ifndef SYSTRAY_H #define SYSTRAY_H -#include - #include "accountmanager.h" #include "tray/usermodel.h" +#include #include +#include class QScreen; class QQmlApplicationEngine; @@ -188,6 +188,8 @@ private slots: QSet _callsAlreadyNotified; QPointer _editFileLocallyLoadingDialog; QVector _fileDetailDialogs; + + QStringListModel _fakeActivityModel; }; } // namespace OCC diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index bbe0330d4af1d..d9ea16dd871d2 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -966,7 +966,7 @@ ApplicationWindow { } Connections { target: activityModel - onInteractiveActivityReceived: { + function onInteractiveActivityReceived() { if (!activityList.atYBeginning) { newActivitiesButtonLoader.active = true; }