Instantiate internal MacImplementation in file provider settings controller

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-09-04 17:11:14 +08:00
parent 27c803a3d8
commit d80962b634
No known key found for this signature in database
GPG Key ID: C839200C384636B0
2 changed files with 8 additions and 2 deletions

View File

@ -27,6 +27,7 @@ class FileProviderSettingsController : public QObject
public:
explicit FileProviderSettingsController(QObject *parent = nullptr);
~FileProviderSettingsController() override;
[[nodiscard]] QQuickWidget *settingsViewWidget();

View File

@ -38,8 +38,9 @@ Q_LOGGING_CATEGORY(lcFileProviderSettingsController, "nextcloud.gui.mac.fileprov
class FileProviderSettingsController::MacImplementation
{
public:
MacImplementation()
MacImplementation(FileProviderSettingsController *const parent)
{
q = parent;
_userDefaults = NSUserDefaults.standardUserDefaults;
};
@ -49,13 +50,17 @@ public:
};
private:
NSUserDefaults *_userDefaults;
FileProviderSettingsController *q = nullptr;
NSUserDefaults *_userDefaults = nil;
};
FileProviderSettingsController::~FileProviderSettingsController() = default;
FileProviderSettingsController::FileProviderSettingsController(QObject *parent)
: QObject{parent}
{
d = std::make_unique<FileProviderSettingsController::MacImplementation>(this);
_settingsViewWidget = std::make_unique<QQuickWidget>(Systray::instance()->trayEngine(), nullptr);
_settingsViewWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
_settingsViewWidget->setSource(QUrl(fpSettingsQmlPath));