From 107fad90f096f877bb7087ee981d611a9d1bc9c3 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 27 Feb 2019 20:38:37 +0100 Subject: [PATCH] Allow to use SyncthingStatistics in QML --- connector/syncthingdir.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/connector/syncthingdir.h b/connector/syncthingdir.h index ad4fb95..c2f8267 100644 --- a/connector/syncthingdir.h +++ b/connector/syncthingdir.h @@ -94,6 +94,14 @@ constexpr bool SyncthingCompletion::Needed::operator!=(const SyncthingCompletion } struct LIB_SYNCTHING_CONNECTOR_EXPORT SyncthingStatistics { + Q_GADGET + Q_PROPERTY(quint64 bytes MEMBER bytes) + Q_PROPERTY(quint64 deletes MEMBER deletes) + Q_PROPERTY(quint64 dirs MEMBER dirs) + Q_PROPERTY(quint64 files MEMBER files) + Q_PROPERTY(quint64 symlinks MEMBER symlinks) + +public: quint64 bytes = 0; quint64 deletes = 0; quint64 dirs = 0; @@ -210,6 +218,12 @@ inline bool SyncthingDir::assignStatus(SyncthingDirStatus newStatus, ChronoUtili } struct LIB_SYNCTHING_CONNECTOR_EXPORT SyncthingOverallDirStatistics { + Q_GADGET + Q_PROPERTY(SyncthingStatistics local MEMBER local) + Q_PROPERTY(SyncthingStatistics global MEMBER global) + Q_PROPERTY(SyncthingStatistics needed MEMBER needed) + +public: SyncthingOverallDirStatistics(); SyncthingOverallDirStatistics(const std::vector &directories);