Display more verbose share display names for shares that have sharees with identical...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 17 Oct 2024 06:00:58 +0000 (14:00 +0800)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 18 Oct 2024 09:05:16 +0000 (11:05 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/filedetails/sharemodel.cpp

index b1e60f84f53cd621fd70995e9be526e58b7542ac..df275c2daa738fd2c6a0126d52d1ed2692b9272e 100644 (file)
@@ -90,7 +90,8 @@ QVariant ShareModel::data(const QModelIndex &index, const int role) const
 {
     Q_ASSERT(checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid | QAbstractItemModel::CheckIndexOption::ParentIsInvalid));
 
-    const auto share = _shares.at(index.row());
+    const auto shareIdx = index.row();
+    const auto share = _shares.at(shareIdx);
 
     if (!share) {
         return {};
@@ -138,7 +139,7 @@ QVariant ShareModel::data(const QModelIndex &index, const int role) const
 
     switch (role) {
     case Qt::DisplayRole:
-        return displayStringForShare(share);
+        return displayStringForShare(share, _duplicateDisplayNameShareIndices.contains(shareIdx));
     case ShareRole:
         return QVariant::fromValue(share);
     case ShareTypeRole: