diff options
author | Kai Koehne <kai.koehne@qt.io> | 2016-11-03 11:17:14 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2016-11-08 15:30:42 +0000 |
commit | b5fa247102c610d8ed4c1d88a7f1ea685b96c91f (patch) | |
tree | 9b0dfff2dc357edbe7c4b5c21cee35f5f3dd7104 | |
parent | aa73a7026fd8093a340b20dacba7b10e5ffa03ac (diff) |
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>
-rw-r--r-- | src/corelib/io/qstandardpaths_win.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<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 { |