From b5fa247102c610d8ed4c1d88a7f1ea685b96c91f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 3 Nov 2016 11:17:14 +0100 Subject: 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 Reviewed-by: Friedemann Kleint --- src/corelib/io/qstandardpaths_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp index 94beed0c1f..a64bde6fb4 100644 --- a/src/corelib/io/qstandardpaths_win.cpp +++ b/src/corelib/io/qstandardpaths_win.cpp @@ -138,7 +138,7 @@ static QString sHGetKnownFolderPath(const GUID &clsid, QStandardPaths::StandardL reinterpret_cast(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 { -- cgit v1.2.3