Enable use of domain sync status class in QML

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-01-15 01:28:11 +08:00
parent f8ebbe8c71
commit 9e235f99fa
No known key found for this signature in database
GPG key ID: C839200C384636B0
2 changed files with 6 additions and 0 deletions

View file

@ -13,6 +13,7 @@
*/
#include <QObject>
#include <QQmlEngine>
#pragma once
@ -22,6 +23,8 @@ namespace OCC::Mac
class FileProviderDomainSyncStatus : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("FileProviderDomainSyncStatus cannot be instantiated from QML")
Q_PROPERTY(bool syncing READ syncing NOTIFY syncingChanged)
Q_PROPERTY(bool downloading READ downloading NOTIFY downloadingChanged)
Q_PROPERTY(bool uploading READ uploading NOTIFY uploadingChanged)
@ -85,3 +88,5 @@ private:
};
} // OCC::Mac
Q_DECLARE_METATYPE(OCC::Mac::FileProviderDomainSyncStatus*)

View file

@ -94,6 +94,7 @@ FileProviderDomainSyncStatus::FileProviderDomainSyncStatus(const QString &domain
: QObject(parent)
, d(std::make_unique<MacImplementation>(domainIdentifier, this))
{
qRegisterMetaType<FileProviderDomainSyncStatus*>("FileProviderDomainSyncStatus*");
}
FileProviderDomainSyncStatus::~FileProviderDomainSyncStatus() = default;