]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Clean up check for equality between sharee display names
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 17 Oct 2024 06:19:37 +0000 (14:19 +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 96640e51e3ba3ff6bef3d61aad19c531c1a90316..c864993f9ec0a68340d7dddd34e1e4efde0b5e8f 100644 (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) {