From: Daniel Molkentin Date: Thu, 10 Sep 2015 08:17:16 +0000 (+0200) Subject: Account: Display non-standard port as part of the hostname X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~1408^2~99 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c0f8ff1030ed1fed1455057d1d33b0eed2f71232;p=nextcloud-desktop.git Account: Display non-standard port as part of the hostname Addresses #3658 --- diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index 76314128a..1dac2ea28 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -257,10 +257,15 @@ QString AccountState::shortDisplayNameForSettings(int width) const { QString user = account()->credentials()->user(); QString host = account()->url().host(); + int port = account()->url().port(); + if (port > 0 && port != 80 && port != 443) { + host.append(QLatin1Char(':')); + host.append(QString::number(port)); + } if (width > 0) { QFont f; QFontMetrics fm(f); - host = fm.elidedText(host, Qt::ElideRight, width); + host = fm.elidedText(host, Qt::ElideMiddle, width); user = fm.elidedText(user, Qt::ElideRight, width); } return user + QLatin1String("\n") + host;