Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>2022-07-11 00:32:25 +0300
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>2022-08-03 18:07:21 +0300
commit784bc65c823cb794f36cd38581a28139341a0865 (patch)
tree0fb7e0c2f85c9378bed01dc440f49e6264a2a70d
parent9563628fd196264e87033331418659a3a33d990c (diff)
improve display of public share link in main dialogfeature/publicLinks
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
-rw-r--r--src/gui/tray/usermodel.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp
index 17a132b0a..e24913708 100644
--- a/src/gui/tray/usermodel.cpp
+++ b/src/gui/tray/usermodel.cpp
@@ -741,6 +741,10 @@ void User::logout() const
QString User::name() const
{
+ if (isPublicShareLink()) {
+ return tr("Public Link");
+ }
+
// If davDisplayName is empty (can be several reasons, simplest is missing login at startup), fall back to username
QString name = _account->account()->davDisplayName();
if (name == "") {
@@ -751,12 +755,18 @@ QString User::name() const
QString User::server(bool shortened) const
{
- QString serverUrl = _account->account()->url().toString();
+ auto serverUrl = _account->account()->url();
+
+ if (isPublicShareLink()) {
+ serverUrl.setUserName({});
+ }
+ QString stringServerUrl = serverUrl.toString();
if (shortened) {
- serverUrl.replace(QLatin1String("https://"), QLatin1String(""));
- serverUrl.replace(QLatin1String("http://"), QLatin1String(""));
+ stringServerUrl.replace(QLatin1String("https://"), QLatin1String(""));
+ stringServerUrl.replace(QLatin1String("http://"), QLatin1String(""));
+
}
- return serverUrl;
+ return stringServerUrl;
}
UserStatus::OnlineStatus User::status() const