do not show hostname in titlebar if it's FQDN of localhost
This commit is contained in:
parent
b0c43762e2
commit
13e6ead66e
1 changed files with 7 additions and 0 deletions
|
@ -421,6 +421,13 @@ bool isLocalMachine(const QByteArray& host)
|
|||
*dot = '\0';
|
||||
if (host == hostnamebuf)
|
||||
return true;
|
||||
} else { // e.g. LibreOffice likes to give FQDN, even if gethostname() doesn't include domain
|
||||
QByteArray h = hostnamebuf;
|
||||
if( getdomainname( hostnamebuf, sizeof hostnamebuf ) >= 0 ) {
|
||||
hostnamebuf[sizeof(hostnamebuf)-1] = 0;
|
||||
if( host == h + '.' + QByteArray( hostnamebuf ))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue