]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Add ability to make share sharee displayname more verbose
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 17 Oct 2024 05:59:23 +0000 (13:59 +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
src/gui/filedetails/sharemodel.h

index 078e3ccb4a3968fe1e941a8b70bf2fbc49f59c91..f184d1c146624ed7b089038bf6b68c5b34102df8 100644 (file)
@@ -642,7 +642,7 @@ void ShareModel::slotRemoveSharee(const ShareePtr &sharee)
     Q_EMIT shareesChanged();
 }
 
-QString ShareModel::displayStringForShare(const SharePtr &share) const
+QString ShareModel::displayStringForShare(const SharePtr &share, const bool verbose) const
 {
     if (const auto linkShare = share.objectCast<LinkShare>()) {
 
@@ -662,7 +662,8 @@ QString ShareModel::displayStringForShare(const SharePtr &share) const
     } else if (share->getShareType() == Share::TypeSecureFileDropPlaceholderLink) {
         return tr("Secure file drop");
     } else if (share->getShareWith()) {
-        return share->getShareWith()->format();
+        const auto sharee = share->getShareWith();
+        return verbose ? QString{"%1 (%2)"}.arg(sharee->format(), sharee->shareWith()) : sharee->format();
     }
 
     qCWarning(lcShareModel) << "Unable to provide good display string for share";
index 694f0d37eeb337e11cc59f0b3115a9c2475668f2..e3b8dffe7fff150157eb6b7eb24204807024e79f 100644 (file)
@@ -217,7 +217,7 @@ private slots:
     void slotDeleteE2EeShare(const SharePtr &share) const;
 
 private:
-    [[nodiscard]] QString displayStringForShare(const SharePtr &share) const;
+    [[nodiscard]] QString displayStringForShare(const SharePtr &share, bool verbose = false) const;
     [[nodiscard]] QString iconUrlForShare(const SharePtr &share) const;
     [[nodiscard]] QString avatarUrlForShare(const SharePtr &share) const;
     [[nodiscard]] long long enforcedMaxExpireDateForShare(const SharePtr &share) const;