Skip to content

Commit

Permalink
Add custom equality check to FileProviderItemMetadata
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Oct 10, 2023
1 parent 6278231 commit bb97660
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/gui/macOS/fileprovideritemmetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ bool FileProviderItemMetadata::sharedByCurrentUser() const
return _sharedByCurrentUser;
}

bool operator==(const FileProviderItemMetadata &lhs, const FileProviderItemMetadata &rhs)
{
return lhs.identifier() == rhs.identifier() &&
lhs.contentVersion() == rhs.contentVersion() &&
lhs.metadataVersion() == rhs.metadataVersion();
}

}
} // namespace Mac

} // namespace OCC
5 changes: 4 additions & 1 deletion src/gui/macOS/fileprovideritemmetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ class FileProviderItemMetadata
bool downloading() const;
bool downloaded() const;
bool shared() const;
bool sharedByCurrentUser() const;
bool sharedByCurrentUser() const;

// Check equality via identifier, contentVersion, and metadataVersion
friend bool operator==(const FileProviderItemMetadata &lhs, const FileProviderItemMetadata &rhs);

private:
QString _identifier;
Expand Down

0 comments on commit bb97660

Please sign in to comment.