Fix env variable on Windows
This commit is contained in:
parent
929fd062f2
commit
b9932769c9
1 changed files with 7 additions and 1 deletions
|
@ -147,7 +147,13 @@ KdeConnectConfig::KdeConnectConfig()
|
|||
|
||||
QString KdeConnectConfig::name()
|
||||
{
|
||||
QString defaultName = qgetenv("USER") + '@' + QHostInfo::localHostName();
|
||||
QString username;
|
||||
#ifdef Q_OS_WIN
|
||||
username = qgetenv("USERNAME");
|
||||
#else
|
||||
username = qgetenv("USER");
|
||||
#endif
|
||||
QString defaultName = username + '@' + QHostInfo::localHostName();
|
||||
QString name = d->m_config->value(QStringLiteral("name"), defaultName).toString();
|
||||
return name;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue