Skip to content

Commit 5923be1

Browse files
committed
improve display of public share link in main dialog
Signed-off-by: Matthieu Gallien <[email protected]>
1 parent 7622d4e commit 5923be1

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/gui/tray/usermodel.cpp

+14-4
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,10 @@ void User::logout() const
741741

742742
QString User::name() const
743743
{
744+
if (isPublicShareLink()) {
745+
return tr("Public Link");
746+
}
747+
744748
// If davDisplayName is empty (can be several reasons, simplest is missing login at startup), fall back to username
745749
QString name = _account->account()->davDisplayName();
746750
if (name == "") {
@@ -751,12 +755,18 @@ QString User::name() const
751755

752756
QString User::server(bool shortened) const
753757
{
754-
QString serverUrl = _account->account()->url().toString();
758+
auto serverUrl = _account->account()->url();
759+
760+
if (isPublicShareLink()) {
761+
serverUrl.setUserName({});
762+
}
763+
QString stringServerUrl = serverUrl.toString();
755764
if (shortened) {
756-
serverUrl.replace(QLatin1String("https://"), QLatin1String(""));
757-
serverUrl.replace(QLatin1String("http://"), QLatin1String(""));
765+
stringServerUrl.replace(QLatin1String("https://"), QLatin1String(""));
766+
stringServerUrl.replace(QLatin1String("http://"), QLatin1String(""));
767+
758768
}
759-
return serverUrl;
769+
return stringServerUrl;
760770
}
761771

762772
UserStatus::OnlineStatus User::status() const

0 commit comments

Comments
 (0)