mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
Add rolenames for FileProviderMaterialisedItemsModel
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
89bb008bd7
commit
bfaba671f3
2 changed files with 37 additions and 0 deletions
|
@ -98,6 +98,42 @@ QVariant FileProviderMaterialisedItemsModel::data(const QModelIndex &index, int
|
||||||
return {};
|
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
|
QVector<FileProviderItemMetadata> FileProviderMaterialisedItemsModel::items() const
|
||||||
{
|
{
|
||||||
return _items;
|
return _items;
|
||||||
|
|
|
@ -64,6 +64,7 @@ public:
|
||||||
explicit FileProviderMaterialisedItemsModel(QObject *parent = nullptr);
|
explicit FileProviderMaterialisedItemsModel(QObject *parent = nullptr);
|
||||||
int rowCount(const QModelIndex &parent = {}) const override;
|
int rowCount(const QModelIndex &parent = {}) const override;
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
|
QHash<int, QByteArray> roleNames() const override;
|
||||||
|
|
||||||
QVector<FileProviderItemMetadata> items() const;
|
QVector<FileProviderItemMetadata> items() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue