mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-23 04:45:43 +03:00
Use prettyName more widely, instead of duplicating fallback string code
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
359627007b
commit
8de5b0ffa5
2 changed files with 2 additions and 10 deletions
|
@ -57,10 +57,7 @@ const float buttonSizeRatio = 1.618f; // golden ratio
|
|||
*/
|
||||
QString shortDisplayNameForSettings(OCC::Account *account, int width)
|
||||
{
|
||||
QString user = account->davDisplayName();
|
||||
if (user.isEmpty()) {
|
||||
user = account->credentials()->user();
|
||||
}
|
||||
QString user = account->prettyName();
|
||||
QString host = account->url().host();
|
||||
int port = account->url().port();
|
||||
if (port > 0 && port != 80 && port != 443) {
|
||||
|
|
|
@ -733,12 +733,7 @@ void User::logout() const
|
|||
|
||||
QString User::name() const
|
||||
{
|
||||
// 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 == "") {
|
||||
name = _account->account()->credentials()->user();
|
||||
}
|
||||
return name;
|
||||
return _account->account()->prettyName();
|
||||
}
|
||||
|
||||
QString User::server(bool shortened) const
|
||||
|
|
Loading…
Reference in a new issue