Get and set userVisiblePath at item metadata construction time

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-10-31 15:51:53 +08:00
parent e03edc131d
commit beb889c2f6
No known key found for this signature in database
GPG key ID: C839200C384636B0
3 changed files with 12 additions and 1 deletions

View file

@ -168,6 +168,11 @@ bool FileProviderItemMetadata::sharedByCurrentUser() const
return _sharedByCurrentUser;
}
QString FileProviderItemMetadata::userVisiblePath() const
{
return _userVisiblePath;
}
bool operator==(const FileProviderItemMetadata &lhs, const FileProviderItemMetadata &rhs)
{
return lhs.identifier() == rhs.identifier() &&

View file

@ -98,6 +98,8 @@ public:
friend bool operator==(const FileProviderItemMetadata &lhs, const FileProviderItemMetadata &rhs);
private:
QString getUserVisiblePath() const;
QString _identifier;
QString _parentItemIdentifier;
QString _domainIdentifier;
@ -130,6 +132,8 @@ private:
bool _shared = false;
bool _sharedByCurrentUser = false;
bool _trashed = false;
QString _userVisiblePath;
};
}

View file

@ -89,10 +89,12 @@ FileProviderItemMetadata FileProviderItemMetadata::fromNSFileProviderItem(const
metadata._shared = bridgedNsFileProviderItem.shared;
metadata._sharedByCurrentUser = bridgedNsFileProviderItem.sharedByCurrentUser;
metadata._userVisiblePath = metadata.getUserVisiblePath();
return metadata;
}
QString FileProviderItemMetadata::userVisiblePath() const
QString FileProviderItemMetadata::getUserVisiblePath() const
{
qCDebug(lcMacImplFileProviderItemMetadata) << "Getting user visible path";