diff options
author | Marcus Tillmanns <marcus.tillmanns@qt.io> | 2022-12-02 08:25:12 +0100 |
---|---|---|
committer | Marcus Tillmanns <marcus.tillmanns@qt.io> | 2022-12-05 07:52:57 +0000 |
commit | 88728a414c823dcd18c5f90866b06d857f0ea96b (patch) | |
tree | 4d64a75390d85ff2b16b41a142c2fb51d5fdee98 | |
parent | 55284ba124077b64d92d55d9db07a8d2a973f573 (diff) |
ProjectExplorer: Fix builtin header path query
Change-Id: Iad8883cef88ac605f5ef3bc7e9922a02e4da5bd3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rw-r--r-- | src/plugins/cppeditor/headerpathfilter.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/gcctoolchain.cpp | 7 | ||||
-rw-r--r-- | src/plugins/projectexplorer/headerpath.h | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/cppeditor/headerpathfilter.cpp b/src/plugins/cppeditor/headerpathfilter.cpp index da1c716bdc..f0644a92b5 100644 --- a/src/plugins/cppeditor/headerpathfilter.cpp +++ b/src/plugins/cppeditor/headerpathfilter.cpp @@ -124,7 +124,7 @@ void HeaderPathFilter::tweakHeaderPaths() auto split = resourceIterator(builtInHeaderPaths); if (!clangIncludeDirectory.isEmpty()) - builtInHeaderPaths.insert(split, HeaderPath::makeBuiltIn(clangIncludeDirectory)); + builtInHeaderPaths.insert(split, HeaderPath::makeBuiltIn(clangIncludeDirectory.path())); } void HeaderPathFilter::addPreIncludesPath() diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index d70ef54d0b..2914c75d7c 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -193,8 +193,11 @@ HeaderPaths GccToolChain::gccHeaderPaths(const FilePath &gcc, thisHeaderKind = HeaderPathType::Framework; } - const QString headerPath = QFileInfo(QFile::decodeName(line)).canonicalFilePath(); - builtInHeaderPaths.append({headerPath, thisHeaderKind}); + const FilePath headerPath + = FilePath::fromString(QString::fromUtf8(line)).onDevice(gcc).canonicalPath(); + + if (!headerPath.isEmpty()) + builtInHeaderPaths.append({headerPath, thisHeaderKind}); } else if (line.startsWith("End of search list.")) { break; } else { diff --git a/src/plugins/projectexplorer/headerpath.h b/src/plugins/projectexplorer/headerpath.h index c93fd4740d..73e3d6ffde 100644 --- a/src/plugins/projectexplorer/headerpath.h +++ b/src/plugins/projectexplorer/headerpath.h @@ -25,7 +25,8 @@ public: HeaderPath(const QString &path, HeaderPathType type) : path(path), type(type) { } HeaderPath(const char *path, HeaderPathType type) : HeaderPath(QLatin1String(path), type) {} HeaderPath(const Utils::FilePath &path, HeaderPathType type) - : HeaderPath(path.toString(), type) { } + : HeaderPath(path.path(), type) + {} bool operator==(const HeaderPath &other) const { |