From: Markus Goetz Date: Mon, 17 Aug 2015 10:38:04 +0000 (+0200) Subject: Settings dialog: Move more common hostname prefixes in toolbar X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~1408^2~210 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6c57d71ca40121a014b9de727c1c84d14cbc0f32;p=nextcloud-desktop.git Settings dialog: Move more common hostname prefixes in toolbar For #3577 --- diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index e7006f38d..925669321 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -259,9 +259,14 @@ QString AccountState::shortDisplayNameForSettings() const userWithoutMailHost = userWithoutMailHost.left(userWithoutMailHost.lastIndexOf('@')); } QString hostWithoutTld = account()->url().host(); - if (hostWithoutTld.contains('.')) { + if (hostWithoutTld.contains('.') && !hostWithoutTld.at(0).isDigit()) { hostWithoutTld = hostWithoutTld.left(hostWithoutTld.lastIndexOf('.')); hostWithoutTld = hostWithoutTld.replace(QLatin1String("www."), QLatin1String("")); + hostWithoutTld = hostWithoutTld.replace(QLatin1String("cloud."), QLatin1String("")); + hostWithoutTld = hostWithoutTld.replace(QLatin1String("sync."), QLatin1String("")); + hostWithoutTld = hostWithoutTld.replace(QLatin1String("drive."), QLatin1String("")); + hostWithoutTld = hostWithoutTld.replace(QLatin1String("share."), QLatin1String("")); + hostWithoutTld = hostWithoutTld.replace(QLatin1String("web."), QLatin1String("")); } return userWithoutMailHost + QLatin1String("\n") + hostWithoutTld;