[users] Hostname is empty if it will not be set

This commit is contained in:
Adriaan de Groot 2022-04-11 11:37:56 +02:00
parent a12c6de2ef
commit 9299bedd7e

View File

@ -201,7 +201,13 @@ public:
QString loginNameStatus() const;
/// The host name (name for the system)
QString hostName() const { return m_hostName; }
QString hostName() const
{
return ( ( hostNameAction() == HostNameAction::EtcHostname )
|| ( hostNameAction() == HostNameAction::SystemdHostname ) )
? m_hostName
: QString();
}
/// Status message about hostname -- empty for "ok"
QString hostNameStatus() const;
/// How to write the hostname