Add access to FileProviderSettingsController in FileProviderSettings page

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-09-04 14:13:35 +08:00
parent f607bfaca1
commit 2863415428
No known key found for this signature in database
GPG key ID: C839200C384636B0
2 changed files with 5 additions and 0 deletions

View file

@ -24,6 +24,7 @@ Page {
id: root
property bool showBorder: true
property var controller: FileProviderSettingsController
title: qsTr("Virtual files settings")

View file

@ -20,6 +20,9 @@
namespace {
constexpr auto fpSettingsQmlPath = "qrc:/qml/src/gui/macOS/ui/FileProviderSettings.qml";
// FileProviderSettingsPage properties -- make sure they match up in QML file!
constexpr auto fpSettingsControllerProp = "FileProviderSettingsController";
} // namespace
namespace OCC {
@ -35,6 +38,7 @@ FileProviderSettingsController::FileProviderSettingsController(QObject *parent)
_settingsViewWidget = std::make_unique<QQuickWidget>(Systray::instance()->trayEngine(), nullptr);
_settingsViewWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
_settingsViewWidget->setSource(QUrl(fpSettingsQmlPath));
_settingsViewWidget->rootContext()->setContextProperty(fpSettingsControllerProp, this);
}
QQuickWidget *FileProviderSettingsController::settingsViewWidget()