Skip to content

Commit 0c6a294

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

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
@@ -716,6 +716,10 @@ void User::logout() const
716716

717717
QString User::name() const
718718
{
719+
if (isPublicShareLink()) {
720+
return tr("Public Link");
721+
}
722+
719723
// If davDisplayName is empty (can be several reasons, simplest is missing login at startup), fall back to username
720724
QString name = _account->account()->davDisplayName();
721725
if (name == "") {
@@ -726,12 +730,18 @@ QString User::name() const
726730

727731
QString User::server(bool shortened) const
728732
{
729-
QString serverUrl = _account->account()->url().toString();
733+
auto serverUrl = _account->account()->url();
734+
735+
if (isPublicShareLink()) {
736+
serverUrl.setUserName({});
737+
}
738+
QString stringServerUrl = serverUrl.toString();
730739
if (shortened) {
731-
serverUrl.replace(QLatin1String("https://"), QLatin1String(""));
732-
serverUrl.replace(QLatin1String("http://"), QLatin1String(""));
740+
stringServerUrl.replace(QLatin1String("https://"), QLatin1String(""));
741+
stringServerUrl.replace(QLatin1String("http://"), QLatin1String(""));
742+
733743
}
734-
return serverUrl;
744+
return stringServerUrl;
735745
}
736746

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

0 commit comments

Comments
 (0)