Skip to content

Commit

Permalink
Get and set userVisiblePath at item metadata construction time
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Oct 31, 2023
1 parent 134db4b commit f249ca5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/gui/macOS/fileprovideritemmetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() &&
Expand Down
4 changes: 4 additions & 0 deletions src/gui/macOS/fileprovideritemmetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class FileProviderItemMetadata
friend bool operator==(const FileProviderItemMetadata &lhs, const FileProviderItemMetadata &rhs);

private:
QString getUserVisiblePath() const;

QString _identifier;
QString _parentItemIdentifier;
QString _domainIdentifier;
Expand Down Expand Up @@ -130,6 +132,8 @@ class FileProviderItemMetadata
bool _shared = false;
bool _sharedByCurrentUser = false;
bool _trashed = false;

QString _userVisiblePath;
};

}
Expand Down
4 changes: 3 additions & 1 deletion src/gui/macOS/fileprovideritemmetadata_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ QString nsNameComponentsToLocalisedQString(NSPersonNameComponents *const nameCom
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";

Expand Down

0 comments on commit f249ca5

Please sign in to comment.