diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2016-11-16 13:26:11 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2017-07-25 14:08:47 +0000 |
commit | 3ff2d70a15fc198f1f5b986d3e738c2150b9595c (patch) | |
tree | 10e74f9db5f2ab6ca1cbca06460f2ea7d4e43400 /tests/auto | |
parent | 03bb4fe6b1910603b5cca1a8f9b2e761ac8299a0 (diff) |
Rework qAppFileName() on MS-Win to handle problems gracefully
Using a stack buffer and then a growing realloc() buffer can be tidily
packaged by using a QVLA. Passing the reported name length to
QString::fromWCharArray() saves the need for 0-termination, even if it
has been missed. This also degrades gracefully to produce an empty
QString when GetModuleFileName fails (returning 0).
Change-Id: If58f5ad8505f66fb67e59572af1ceb60a068f0ab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Diffstat (limited to 'tests/auto')
0 files changed, 0 insertions, 0 deletions