mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
Settings dialog: Move more common hostname prefixes in toolbar
For #3577
This commit is contained in:
parent
64bd6b204b
commit
6c57d71ca4
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue