Skip to content

Commit

Permalink
Add rolenames for FileProviderMaterialisedItemsModel
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Oct 17, 2023
1 parent ad14f2f commit c1293e6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/gui/macOS/fileprovidermaterialiseditemsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,42 @@ QVariant FileProviderMaterialisedItemsModel::data(const QModelIndex &index, int
return {};
}

QHash<int, QByteArray> FileProviderMaterialisedItemsModel::roleNames() const
{
auto roleNames = QAbstractListModel::roleNames();
roleNames.insert({
{ IdentifierRole, "identifier" },
{ ParentItemIdentifierRole, "parentItemIdentifier" },
{ FilenameRole, "fileName" },
{ TypeIdentifierRole, "typeIdentifier" },
{ SymlinkTargetPathRole, "symlinkTargetPath" },
{ UploadingErrorRole, "uploadingError" },
{ DownloadingErrorRole, "downloadingError" },
{ MostRecentEditorNameRole, "mostRecentEditorName" },
{ OwnerNameRole, "ownerName" },
{ ContentModificationDateRole, "contentModificationDate" },
{ CreationDateRole, "creationDate" },
{ LastUsedDateRole, "lastUsedDate" },
{ ContentVersionRole, "contentVersion" },
{ MetadataVersionRole, "metadataVersion" },
{ TagDataRole, "tagData" },
{ CapabilitiesRole, "capabilities" },
{ FileSystemFlagsRole, "fileSystemFlags" },
{ ChildItemCountRole, "childItemCount" },
{ TypeOsCodeRole, "typeOsCode" },
{ CreatorOsCodeRole, "creatorOsCode" },
{ DocumentSizeRole, "documentSize" },
{ MostRecentVersionDownloadedRole, "mostRecentVersionDownloaded" },
{ UploadingRole, "uploading" },
{ UploadedRole, "uploaded" },
{ DownloadingRole, "downloading" },
{ DownloadedRole, "downloaded" },
{ SharedRole, "shared" },
{ SharedByCurrentUserRole, "sharedByCurrentUser" },
});
return roleNames;
}

QVector<FileProviderItemMetadata> FileProviderMaterialisedItemsModel::items() const
{
return _items;
Expand Down
1 change: 1 addition & 0 deletions src/gui/macOS/fileprovidermaterialiseditemsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class FileProviderMaterialisedItemsModel : public QAbstractListModel
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;

QVector<FileProviderItemMetadata> items() const;

Expand Down

0 comments on commit c1293e6

Please sign in to comment.