Commit 730f7716 authored by Claudio Valerio's avatar Claudio Valerio

implemented computer name function

parent c7d95fe3
......@@ -86,8 +86,14 @@ QString UBPlatformUtils::osUserLoginName()
QString UBPlatformUtils::computerName()
{
// TODO Linux implement me
return "Not Implemented";
char hostname[256];
memset(hostname,0,256);
// if the name is longer than 255 the name is truncated but os doesn't ensure
// that the last character returned is a null character
if(!gethostname(hostname,255))
return QString::fromAscii(hostname);
else
return "NOT FOUND";
}
void UBPlatformUtils::setWindowNonActivableFlag(QWidget* widget, bool nonAcivable)
......
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