From 988e3ad814d602cb9db35b0cfed22fc822c489ff Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 31 Oct 2023 16:20:25 +0800 Subject: [PATCH] Add file type role to FileProviderMaterialisedItemsModel Signed-off-by: Claudio Cambra --- src/gui/macOS/fileprovidermaterialiseditemsmodel.cpp | 3 +++ src/gui/macOS/fileprovidermaterialiseditemsmodel.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/gui/macOS/fileprovidermaterialiseditemsmodel.cpp b/src/gui/macOS/fileprovidermaterialiseditemsmodel.cpp index 7a06f42e81f0..35bce50dc50f 100644 --- a/src/gui/macOS/fileprovidermaterialiseditemsmodel.cpp +++ b/src/gui/macOS/fileprovidermaterialiseditemsmodel.cpp @@ -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 {}; } @@ -133,6 +135,7 @@ QHash FileProviderMaterialisedItemsModel::roleNames() const { SharedRole, "shared" }, { SharedByCurrentUserRole, "sharedByCurrentUser" }, { UserVisiblePathRole, "userVisiblePath" }, + { FileTypeRole, "fileType" }, }); return roleNames; } diff --git a/src/gui/macOS/fileprovidermaterialiseditemsmodel.h b/src/gui/macOS/fileprovidermaterialiseditemsmodel.h index b2870535c9d4..faae4b9598cc 100644 --- a/src/gui/macOS/fileprovidermaterialiseditemsmodel.h +++ b/src/gui/macOS/fileprovidermaterialiseditemsmodel.h @@ -59,6 +59,7 @@ class FileProviderMaterialisedItemsModel : public QAbstractListModel SharedRole, SharedByCurrentUserRole, UserVisiblePathRole, + FileTypeRole, }; Q_ENUM(Roles)