Skip to content

Commit

Permalink
Account: Display non-standard port as part of the hostname
Browse files Browse the repository at this point in the history
Addresses owncloud#3658
  • Loading branch information
Daniel Molkentin committed Sep 10, 2015
1 parent 8e2b9c6 commit c0f8ff1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gui/accountstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c0f8ff1

Please sign in to comment.