Skip to content

Commit

Permalink
Ensure [[nodiscard]] in new file provider classes
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Feb 5, 2024
1 parent c91876d commit c6611b0
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 49 deletions.
22 changes: 11 additions & 11 deletions src/gui/macOS/fileproviderdomainsyncstatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ class FileProviderDomainSyncStatus : public QObject
explicit FileProviderDomainSyncStatus(const QString &domainIdentifier, QObject *parent = nullptr);
~FileProviderDomainSyncStatus() override;

bool syncing() const;
bool downloading() const;
bool uploading() const;
double fractionCompleted() const;
double downloadFractionCompleted() const;
double uploadFractionCompleted() const;
int downloadFileTotalCount() const;
int downloadFileCompletedCount() const;
int uploadFileTotalCount() const;
int uploadFileCompletedCount() const;
QUrl icon() const;
[[nodiscard]] bool syncing() const;
[[nodiscard]] bool downloading() const;
[[nodiscard]] bool uploading() const;
[[nodiscard]] double fractionCompleted() const;
[[nodiscard]] double downloadFractionCompleted() const;
[[nodiscard]] double uploadFractionCompleted() const;
[[nodiscard]] int downloadFileTotalCount() const;
[[nodiscard]] int downloadFileCompletedCount() const;
[[nodiscard]] int uploadFileTotalCount() const;
[[nodiscard]] int uploadFileCompletedCount() const;
[[nodiscard]] QUrl icon() const;

signals:
void syncingChanged(bool syncing);
Expand Down
68 changes: 34 additions & 34 deletions src/gui/macOS/fileprovideritemmetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,45 +61,45 @@ class FileProviderItemMetadata
public:
static FileProviderItemMetadata fromNSFileProviderItem(const void *const nsFileProviderItem, const QString &domainIdentifier);

QString identifier() const;
QString parentItemIdentifier() const;
QString domainIdentifier() const;
QString filename() const;
QString typeIdentifier() const;
QString symlinkTargetPath() const;
QString uploadingError() const;
QString downloadingError() const;
QString mostRecentEditorName() const;
QString ownerName() const;
QDateTime contentModificationDate() const;
QDateTime creationDate() const;
QDateTime lastUsedDate() const;
QByteArray contentVersion() const;
QByteArray metadataVersion() const;
QByteArray tagData() const;
QHash<QString, QByteArray> extendedAttributes() const;
int capabilities() const;
int fileSystemFlags() const;
unsigned int childItemCount() const;
unsigned int typeOsCode() const;
unsigned int creatorOsCode() const;
unsigned long long documentSize() const;
bool mostRecentVersionDownloaded() const;
bool uploading() const;
bool uploaded() const;
bool downloading() const;
bool downloaded() const;
bool shared() const;
bool sharedByCurrentUser() const;

QString userVisiblePath() const;
QString fileTypeString() const;
[[nodiscard]] QString identifier() const;
[[nodiscard]] QString parentItemIdentifier() const;
[[nodiscard]] QString domainIdentifier() const;
[[nodiscard]] QString filename() const;
[[nodiscard]] QString typeIdentifier() const;
[[nodiscard]] QString symlinkTargetPath() const;
[[nodiscard]] QString uploadingError() const;
[[nodiscard]] QString downloadingError() const;
[[nodiscard]] QString mostRecentEditorName() const;
[[nodiscard]] QString ownerName() const;
[[nodiscard]] QDateTime contentModificationDate() const;
[[nodiscard]] QDateTime creationDate() const;
[[nodiscard]] QDateTime lastUsedDate() const;
[[nodiscard]] QByteArray contentVersion() const;
[[nodiscard]] QByteArray metadataVersion() const;
[[nodiscard]] QByteArray tagData() const;
[[nodiscard]] QHash<QString, QByteArray> extendedAttributes() const;
[[nodiscard]] int capabilities() const;
[[nodiscard]] int fileSystemFlags() const;
[[nodiscard]] unsigned int childItemCount() const;
[[nodiscard]] unsigned int typeOsCode() const;
[[nodiscard]] unsigned int creatorOsCode() const;
[[nodiscard]] unsigned long long documentSize() const;
[[nodiscard]] bool mostRecentVersionDownloaded() const;
[[nodiscard]] bool uploading() const;
[[nodiscard]] bool uploaded() const;
[[nodiscard]] bool downloading() const;
[[nodiscard]] bool downloaded() const;
[[nodiscard]] bool shared() const;
[[nodiscard]] bool sharedByCurrentUser() const;

[[nodiscard]] QString userVisiblePath() const;
[[nodiscard]] QString fileTypeString() const;

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

private:
QString getUserVisiblePath() const;
[[nodiscard]] QString getUserVisiblePath() const;

QString _identifier;
QString _parentItemIdentifier;
Expand Down
8 changes: 4 additions & 4 deletions src/gui/macOS/fileprovidermaterialiseditemsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ class FileProviderMaterialisedItemsModel : public QAbstractListModel
Q_ENUM(Roles)

explicit FileProviderMaterialisedItemsModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = {}) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QHash<int, QByteArray> roleNames() const override;
[[nodiscard]] int rowCount(const QModelIndex &parent = {}) const override;
[[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;

QVector<FileProviderItemMetadata> items() const;
[[nodiscard]] QVector<FileProviderItemMetadata> items() const;

signals:
void itemsChanged();
Expand Down

0 comments on commit c6611b0

Please sign in to comment.