Skip to content

Commit

Permalink
fix some of the qml issues
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Apr 8, 2024
1 parent 6047e55 commit 7e96369
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/gui/systray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ void Systray::create()
if (_trayEngine) {
if (!AccountManager::instance()->accounts().isEmpty()) {

Check warning on line 116 in src/gui/systray.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/systray.cpp:116:9 [bugprone-branch-clone]

if with identical then and else branches
_trayEngine->rootContext()->setContextProperty("activityModel", UserModel::instance()->currentActivityModel());
} else {
_trayEngine->rootContext()->setContextProperty("activityModel", &_fakeActivityModel);
}

QQmlComponent trayWindowComponent(trayEngine(), QStringLiteral("qrc:/qml/src/gui/tray/Window.qml"));
Expand Down
6 changes: 4 additions & 2 deletions src/gui/systray.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#ifndef SYSTRAY_H
#define SYSTRAY_H

#include <QSystemTrayIcon>

#include "accountmanager.h"
#include "tray/usermodel.h"

#include <QSystemTrayIcon>
#include <QQmlNetworkAccessManagerFactory>
#include <QStringListModel>

class QScreen;
class QQmlApplicationEngine;
Expand Down Expand Up @@ -188,6 +188,8 @@ private slots:
QSet<qlonglong> _callsAlreadyNotified;
QPointer<QObject> _editFileLocallyLoadingDialog;
QVector<QQuickWindow*> _fileDetailDialogs;

QStringListModel _fakeActivityModel;
};

} // namespace OCC
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/Window.qml
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ ApplicationWindow {
}
Connections {
target: activityModel
onInteractiveActivityReceived: {
function onInteractiveActivityReceived() {
if (!activityList.atYBeginning) {
newActivitiesButtonLoader.active = true;
}
Expand Down

0 comments on commit 7e96369

Please sign in to comment.