Clean up check for equality between sharee display names

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-10-17 14:19:37 +08:00 committed by backportbot[bot]
parent c42617c2f8
commit cc4e2591ec

View file

@ -504,16 +504,14 @@ void ShareModel::slotSharesFetched(const QList<SharePtr> &shares)
auto hasDuplicates = false;
for (auto j = i + 1; j < shareCount; ++j) {
const auto otherSharee = _shares.at(j)->getShareWith();
if (otherSharee == nullptr) {
if (otherSharee == nullptr || sharee->format() != otherSharee->format()) {
continue;
}
if (sharee->format() == otherSharee->format()) {
hasDuplicates = true; // Reassign is faster
_duplicateDisplayNameShareIndices.insert(j);
const auto targetIndex = index(j);
dataChanged(targetIndex, targetIndex, {Qt::DisplayRole});
}
hasDuplicates = true; // Reassign is faster
_duplicateDisplayNameShareIndices.insert(j);
const auto targetIndex = index(j);
dataChanged(targetIndex, targetIndex, {Qt::DisplayRole});
}
if (hasDuplicates) {