QStandardPaths: Do not check whether path exists (Windows)
It's arguably better to return a non-existing location than no location at all. This makes it in line with the documentation for e.g. QStandardPaths::writableLocation that says Note: The storage location returned can be a directory that does not exist; i.e., it may need to be created by the system or the user. Finally, this was also the behavior of code that used SHGetSpecialFolderPath before. Change-Id: I5ee44747a38434535610e45a4d303b36ef79d42a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>bb10
parent
aa73a7026f
commit
b5fa247102
|
|
@ -138,7 +138,7 @@ static QString sHGetKnownFolderPath(const GUID &clsid, QStandardPaths::StandardL
|
|||
reinterpret_cast<GetKnownFolderPath>(QSystemLibrary::resolve(QLatin1String("shell32"), "SHGetKnownFolderPath"));
|
||||
|
||||
LPWSTR path;
|
||||
if (Q_LIKELY(sHGetKnownFolderPath && SUCCEEDED(sHGetKnownFolderPath(clsid, 0, 0, &path)))) {
|
||||
if (Q_LIKELY(sHGetKnownFolderPath && SUCCEEDED(sHGetKnownFolderPath(clsid, KF_FLAG_DONT_VERIFY, 0, &path)))) {
|
||||
result = convertCharArray(path);
|
||||
CoTaskMemFree(path);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue