From e0d3fc5b2019b0639f5944f8119cbbd978f7dc45 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Sun, 20 Oct 2024 17:33:14 +0800 Subject: [PATCH] Add sharedWithMe-related properties to sharemodel Signed-off-by: Claudio Cambra --- src/gui/filedetails/sharemodel.cpp | 10 ++++++++++ src/gui/filedetails/sharemodel.h | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/gui/filedetails/sharemodel.cpp b/src/gui/filedetails/sharemodel.cpp index 6eca76461..c8257e8df 100644 --- a/src/gui/filedetails/sharemodel.cpp +++ b/src/gui/filedetails/sharemodel.cpp @@ -1404,6 +1404,16 @@ QString ShareModel::fileOwnerDisplayName() const return _fileOwnerDisplayName; } +QString ShareModel::sharedWithMeRemainingTimeString() const +{ + return _sharedWithMeRemainingTimeString; +} + +bool ShareModel::sharedWithMeExpires() const +{ + return _sharedWithMeExpires; +} + QVariantList ShareModel::sharees() const { QVariantList returnSharees; diff --git a/src/gui/filedetails/sharemodel.h b/src/gui/filedetails/sharemodel.h index 0bc4647d3..3608f0e97 100644 --- a/src/gui/filedetails/sharemodel.h +++ b/src/gui/filedetails/sharemodel.h @@ -40,6 +40,8 @@ class ShareModel : public QAbstractListModel Q_PROPERTY(QVariantList sharees READ sharees NOTIFY shareesChanged) Q_PROPERTY(bool displayFileOwner READ displayFileOwner NOTIFY displayFileOwnerChanged) Q_PROPERTY(QString fileOwnerDisplayName READ fileOwnerDisplayName NOTIFY fileOwnerDisplayNameChanged) + Q_PROPERTY(bool sharedWithMeExpires READ sharedWithMeExpires NOTIFY sharedWithMeExpiresChanged) + Q_PROPERTY(QString sharedWithMeRemainingTimeString READ sharedWithMeRemainingTimeString NOTIFY sharedWithMeRemainingTimeStringChanged) public: enum Roles { @@ -130,6 +132,9 @@ public: [[nodiscard]] bool displayFileOwner() const; [[nodiscard]] QString fileOwnerDisplayName() const; + [[nodiscard]] bool sharedWithMeExpires() const; + [[nodiscard]] QString sharedWithMeRemainingTimeString() const; + [[nodiscard]] Q_INVOKABLE static QString generatePassword(); signals: @@ -149,6 +154,8 @@ signals: void serverAllowsResharingChanged(); void displayFileOwnerChanged(); void fileOwnerDisplayNameChanged(); + void sharedWithMeExpiresChanged(); + void sharedWithMeRemainingTimeStringChanged(); void serverError(const int code, const QString &message) const; void passwordSetError(const QString &shareId, const int code, const QString &message); @@ -254,6 +261,8 @@ private: QByteArray _fileRemoteId; bool _displayFileOwner = false; QString _fileOwnerDisplayName; + bool _sharedWithMeExpires = false; + QString _sharedWithMeRemainingTimeString; QSharedPointer _manager; -- 2.39.5