From 9299bedd7e37e8f0523e27a8585ca7031bac561c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 11 Apr 2022 11:37:56 +0200 Subject: [PATCH] [users] Hostname is empty if it will not be set --- src/modules/users/Config.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/users/Config.h b/src/modules/users/Config.h index 7096674d3..14e29d1e6 100644 --- a/src/modules/users/Config.h +++ b/src/modules/users/Config.h @@ -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