diff options
author | Claudio Cambra <claudio.cambra@nextcloud.com> | 2022-10-06 20:47:39 +0300 |
---|---|---|
committer | Claudio Cambra <claudio.cambra@nextcloud.com> | 2022-10-19 14:31:48 +0300 |
commit | 8de5b0ffa54d77d7c9bccd05c95814ea4536b831 (patch) | |
tree | afd5b95961aef3df738c821ce89564e538fd0324 /src | |
parent | 359627007b16864dd012dfbcb83f8086dd065f6a (diff) |
Use prettyName more widely, instead of duplicating fallback string code
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/settingsdialog.cpp | 5 | ||||
-rw-r--r-- | src/gui/tray/usermodel.cpp | 7 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index e66cd2a96..399e55df3 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -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) { diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index 76a857064..79c75d4eb 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -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 |