From cc5f7b7ee7be45ae90be45c2e3f647149f66b721 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 25 Sep 2024 10:52:34 +0200 Subject: [PATCH 1/3] change the order of imports in Window.qml Signed-off-by: Matthieu Gallien --- src/gui/tray/Window.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 9ec57f16c..be7ede737 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -12,9 +12,10 @@ * for more details. */ +import QtQml import QtQuick -import QtQuick.Window import QtQuick.Controls +import QtQuick.Window import QtQuick.Layouts import Qt5Compat.GraphicalEffects import Qt.labs.platform as NativeDialogs From 8114caaffc6821a0fa1dd320d3563ecc676ec0f1 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 25 Sep 2024 10:56:06 +0200 Subject: [PATCH 2/3] rename our Window component to MainWindow to not use an existing name we import QtQuick module that also define Window component name to avoid any ambiguity, just use a different name on our side Signed-off-by: Matthieu Gallien --- resources.qrc | 2 +- src/gui/systray.cpp | 2 +- src/gui/tray/{Window.qml => MainWindow.qml} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/gui/tray/{Window.qml => MainWindow.qml} (100%) diff --git a/resources.qrc b/resources.qrc index c3c3a76cf..630251749 100644 --- a/resources.qrc +++ b/resources.qrc @@ -21,7 +21,7 @@ src/gui/filedetails/ShareDetailsPage.qml src/gui/filedetails/ShareeSearchField.qml src/gui/filedetails/ShareView.qml - src/gui/tray/Window.qml + src/gui/tray/MainWindow.qml src/gui/tray/UserLine.qml src/gui/tray/HeaderButton.qml src/gui/tray/SyncStatus.qml diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index a0153911e..456e7e618 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -119,7 +119,7 @@ void Systray::create() _trayEngine->rootContext()->setContextProperty("activityModel", &_fakeActivityModel); } - QQmlComponent trayWindowComponent(trayEngine(), QStringLiteral("qrc:/qml/src/gui/tray/Window.qml")); + QQmlComponent trayWindowComponent(trayEngine(), QStringLiteral("qrc:/qml/src/gui/tray/MainWindow.qml")); if(trayWindowComponent.isError()) { qCWarning(lcSystray) << trayWindowComponent.errorString(); diff --git a/src/gui/tray/Window.qml b/src/gui/tray/MainWindow.qml similarity index 100% rename from src/gui/tray/Window.qml rename to src/gui/tray/MainWindow.qml From 653f8d0788094871b4d8fe970e2185cbaca24990 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 25 Sep 2024 11:37:20 +0200 Subject: [PATCH 3/3] add seemingly needed qml import path will hopefuly make the qml engine search inside install dir within qml sub folder Close #7156 Signed-off-by: Matthieu Gallien --- src/gui/systray.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index 456e7e618..85fee594c 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -70,6 +70,7 @@ void Systray::setTrayEngine(QQmlApplicationEngine *trayEngine) _trayEngine->setNetworkAccessManagerFactory(&_accessManagerFactory); + _trayEngine->addImportPath(QCoreApplication::applicationDirPath() + "/qml"); _trayEngine->addImportPath("qrc:/qml/theme"); _trayEngine->addImageProvider("avatars", new ImageProvider); _trayEngine->addImageProvider(QLatin1String("svgimage-custom-color"), new OCC::Ui::SvgImageProvider);