Add sharedWithMe-related properties to sharemodel

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-10-20 17:33:14 +08:00
parent b687f1b2c2
commit 4fdac399f0
No known key found for this signature in database
GPG key ID: C839200C384636B0
2 changed files with 19 additions and 0 deletions
src/gui/filedetails

View file

@ -1351,6 +1351,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;

View file

@ -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<ShareManager> _manager;