hopefully fix windows compilation error

This commit is contained in:
ArsenArsen 2018-02-02 20:43:43 +01:00
parent b9d7deb462
commit 4a667ae270
No known key found for this signature in database
GPG Key ID: 683D2F43B0CA4BD2

View File

@ -46,10 +46,12 @@ bool PlatformBackend::filenameValid(QString name) {
} }
QString PlatformBackend::getCurrentUser() { QString PlatformBackend::getCurrentUser() {
char username[UNLEN + 1]; LPWSTR username[UNLEN + 1];
DWORD username_len = UNLEN + 1; DWORD username_len = UNLEN + 1;
GetUserName(username, &username_len); QString userName;
QString userName = QString::fromLocal8Bit(username, username_len); if (GetUserName(username, &username_len)) {
userName = QString::fromLocal8Bit(username, username_len);
}
delete[] username; delete[] username;
return userName; return userName;
} }