diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2022-09-12 20:26:36 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2022-09-13 11:13:01 +0000 |
commit | 02ac16128be3ac894bd86d37c45ac154a4a07843 (patch) | |
tree | 66512ba4a589957d3e804bd0934b9c14db7fcd96 /src/plugins/projectexplorer/jsonwizard | |
parent | f7efefb6d497110c1113e2d1affc9dbc53ac3a0f (diff) | |
download | qt-creator-02ac16128be3ac894bd86d37c45ac154a4a07843.tar.gz |
ProjectExplorer: Fix directories as filesource in JsonWizard
In addition to file names, Json wizards can define directories as
"File" source. That triggers a specialized code path which broke
with the conversion to using Utils::FilePath.
Amends: 389b1eceb95e237fba0724ce6eef10b27c195d59
Change-Id: I17be01dd04f3fe053966a87e16882659e341da5e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/jsonwizard')
-rw-r--r-- | src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp index 9ac3868593..4a19153583 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp @@ -177,8 +177,8 @@ Core::GeneratedFiles JsonWizardFileGenerator::fileList(Utils::MacroExpander *exp sourceDir.dirEntries(QDir::NoDotAndDotDot | QDir::Files| QDir::Hidden); for (const Utils::FilePath &entry : entries) { - const Utils::FilePath relativeFilePath = sourceDir.relativeChildPath(entry); - const Utils::FilePath targetPath = dir.target / relativeFilePath.toString(); + const QString relativeFilePath = entry.relativeChildPath(sourceDir).path(); + const Utils::FilePath targetPath = dir.target / relativeFilePath; if (knownFiles.contains(targetPath)) continue; @@ -186,7 +186,7 @@ Core::GeneratedFiles JsonWizardFileGenerator::fileList(Utils::MacroExpander *exp // initialize each new file with properties (isBinary etc) // from the current directory json entry File newFile = dir; - newFile.source = dir.source / relativeFilePath.toString(); + newFile.source = dir.source / relativeFilePath; newFile.target = targetPath; fileList.append(newFile); } |