Skip to content

Commit

Permalink
Add file type role to 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 31, 2023
1 parent 08c8864 commit 988e3ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gui/macOS/fileprovidermaterialiseditemsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ QVariant FileProviderMaterialisedItemsModel::data(const QModelIndex &index, int
return item.sharedByCurrentUser();
case UserVisiblePathRole:
return item.userVisiblePath();
case FileTypeRole:
return item.fileTypeString();
}
return {};
}
Expand Down Expand Up @@ -133,6 +135,7 @@ QHash<int, QByteArray> FileProviderMaterialisedItemsModel::roleNames() const
{ SharedRole, "shared" },
{ SharedByCurrentUserRole, "sharedByCurrentUser" },
{ UserVisiblePathRole, "userVisiblePath" },
{ FileTypeRole, "fileType" },
});
return roleNames;
}
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 @@ -59,6 +59,7 @@ class FileProviderMaterialisedItemsModel : public QAbstractListModel
SharedRole,
SharedByCurrentUserRole,
UserVisiblePathRole,
FileTypeRole,
};
Q_ENUM(Roles)

Expand Down

0 comments on commit 988e3ad

Please sign in to comment.