diff options
author | hjk <hjk@qt.io> | 2023-05-23 09:44:54 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2023-05-23 14:08:22 +0000 |
commit | b3f74783739abbd201d6dd0ad4d541fc157761d4 (patch) | |
tree | 9d61cea60d4c7e67ca140e54603328537eae5c75 /src/plugins/coco | |
parent | b1957888dd6eb26124dee8c865c5769f59113d09 (diff) |
Coco: Use FilePath::searchInPath instead of Environment::searchInPath
Not obviously better in this case, but I'd like to centralize
searching on the FilePath side.
Change-Id: I27cec97c0590cf27c3659b3aa262b86439670679
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/coco')
-rw-r--r-- | src/plugins/coco/cocoplugin.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/coco/cocoplugin.cpp b/src/plugins/coco/cocoplugin.cpp index abea861af1e..f192b70a62a 100644 --- a/src/plugins/coco/cocoplugin.cpp +++ b/src/plugins/coco/cocoplugin.cpp @@ -40,12 +40,13 @@ void CocoPluginPrivate::startCoco() auto layout = new QFormLayout(); const Environment env = Environment::systemEnvironment(); - FilePath squishCocoPath = FilePath::fromString(env.value("SQUISHCOCO")); - const FilePaths candidates = env.findAllInPath("coveragebrowser", {squishCocoPath}); + const FilePath squishCocoPath = FilePath::fromUserInput(env.value("SQUISHCOCO")); + const FilePath candidate = FilePath("coveragebrowser").searchInPath({squishCocoPath}, + FilePath::PrependToPath); PathChooser cocoChooser; - if (!candidates.isEmpty()) - cocoChooser.setFilePath(candidates.first()); + if (!candidate.isEmpty()) + cocoChooser.setFilePath(candidate); cocoChooser.setExpectedKind(PathChooser::Command); cocoChooser.setPromptDialogTitle(Tr::tr("Select a Squish Coco CoverageBrowser Executable")); |