From c0f8ff1030ed1fed1455057d1d33b0eed2f71232 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Thu, 10 Sep 2015 10:17:16 +0200 Subject: [PATCH] Account: Display non-standard port as part of the hostname Addresses #3658 --- src/gui/accountstate.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.30.2