Commit c24ea2b4 authored by Luboš Luňák's avatar Luboš Luňák
Browse files

do not show hostname in titlebar if it's FQDN of localhost

parent 711a4af8
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment