Expose items' domain identifier in FileProviderMaterialisedItemsModel

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-10-31 17:28:23 +08:00
parent 0b961e9e17
commit c763a9a227
No known key found for this signature in database
GPG key ID: C839200C384636B0
2 changed files with 4 additions and 0 deletions

View file

@ -44,6 +44,8 @@ QVariant FileProviderMaterialisedItemsModel::data(const QModelIndex &index, int
return item.identifier(); return item.identifier();
case ParentItemIdentifierRole: case ParentItemIdentifierRole:
return item.parentItemIdentifier(); return item.parentItemIdentifier();
case DomainIdentifierRole:
return item.domainIdentifier();
case TypeIdentifierRole: case TypeIdentifierRole:
return item.typeIdentifier(); return item.typeIdentifier();
case SymlinkTargetPathRole: case SymlinkTargetPathRole:
@ -108,6 +110,7 @@ QHash<int, QByteArray> FileProviderMaterialisedItemsModel::roleNames() const
roleNames.insert({ roleNames.insert({
{ IdentifierRole, "identifier" }, { IdentifierRole, "identifier" },
{ ParentItemIdentifierRole, "parentItemIdentifier" }, { ParentItemIdentifierRole, "parentItemIdentifier" },
{ DomainIdentifierRole, "domainIdentifier" },
{ FilenameRole, "fileName" }, { FilenameRole, "fileName" },
{ TypeIdentifierRole, "typeIdentifier" }, { TypeIdentifierRole, "typeIdentifier" },
{ SymlinkTargetPathRole, "symlinkTargetPath" }, { SymlinkTargetPathRole, "symlinkTargetPath" },

View file

@ -32,6 +32,7 @@ public:
enum Roles { enum Roles {
IdentifierRole = Qt::UserRole + 1, IdentifierRole = Qt::UserRole + 1,
ParentItemIdentifierRole, ParentItemIdentifierRole,
DomainIdentifierRole,
FilenameRole, FilenameRole,
TypeIdentifierRole, TypeIdentifierRole,
SymlinkTargetPathRole, SymlinkTargetPathRole,