Commit c7dbcff5 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

osinfo: Also check if pretty hostname is empty

Right now the code just checks if the pretty hostname exists, not if it
is empty. This fixes that.
parent 04200fac
...@@ -190,8 +190,9 @@ void LinuxPrivate::update() ...@@ -190,8 +190,9 @@ void LinuxPrivate::update()
kernelVersionProperty->setValue(kernelVersion); kernelVersionProperty->setValue(kernelVersion);
kernelPrettyNameProperty->setValue(QString{kernelName % QLatin1Char(' ') % kernelVersion}); kernelPrettyNameProperty->setValue(QString{kernelName % QLatin1Char(' ') % kernelVersion});
if (properties.contains(QStringLiteral("PrettyHostname"))) { auto prettyHostName = properties.value(QStringLiteral("PrettyHostname"), QString{}).toString();
hostnameProperty->setValue(properties.value(QStringLiteral("PrettyHostname"))); if (!prettyHostName.isEmpty()) {
hostnameProperty->setValue(prettyHostName);
} else { } else {
hostnameProperty->setValue(properties.value(QStringLiteral("Hostname"), hostnameProperty->value())); hostnameProperty->setValue(properties.value(QStringLiteral("Hostname"), hostnameProperty->value()));
} }
......
Markdown is supported
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