From e43b7c938a13bf92f4172bd4c1e5c776c19649f3 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 17 Oct 2024 14:00:58 +0800 Subject: [PATCH] Display more verbose share display names for shares that have sharees with identical display names Signed-off-by: Claudio Cambra --- src/gui/filedetails/sharemodel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/filedetails/sharemodel.cpp b/src/gui/filedetails/sharemodel.cpp index b1e60f84f..df275c2da 100644 --- a/src/gui/filedetails/sharemodel.cpp +++ b/src/gui/filedetails/sharemodel.cpp @@ -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: -- 2.30.2