Fixed compilation error: cannot convert wchar_t* to LPSTR {aka char*} (#29)

This commit is contained in:
Vitaly Tonkacheyev 2017-02-23 15:41:11 +02:00 committed by Itay Grudev
parent d561026d83
commit eee5d9544b

View File

@ -99,7 +99,7 @@ void SingleApplicationPrivate::genBlockServerName( int timeout )
wchar_t username [ UNLEN + 1 ];
// Specifies size of the buffer on input
DWORD usernameLength = UNLEN + 1;
if( GetUserName( username, &usernameLength ) ) {
if( GetUserNameW( username, &usernameLength ) ) {
appData.addData( QString::fromWCharArray(username).toUtf8() );
} else {
appData.addData( QStandardPaths::standardLocations( QStandardPaths::HomeLocation ).join("").toUtf8() );