forked from qt-creator/qt-creator
Docker: Add default search path for docker binary
Change-Id: I86e02f726e9dac7302c3435f53fdb47c70fffafd Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "dockerconstants.h"
|
||||
#include "dockertr.h"
|
||||
#include "utils/hostosinfo.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
@@ -22,10 +23,17 @@ DockerSettings::DockerSettings()
|
||||
setSettingsGroup(Constants::DOCKER);
|
||||
setAutoApply(false);
|
||||
|
||||
FilePaths additionalPaths;
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
additionalPaths.append("C:/Program Files/Docker/Docker/resources/bin");
|
||||
else
|
||||
additionalPaths.append("/usr/local/bin");
|
||||
|
||||
registerAspect(&dockerBinaryPath);
|
||||
dockerBinaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||
dockerBinaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
||||
dockerBinaryPath.setDefaultFilePath(FilePath::fromString("docker").searchInPath({"/usr/local/bin"}));
|
||||
dockerBinaryPath.setDefaultFilePath(
|
||||
FilePath::fromString("docker").searchInPath(additionalPaths));
|
||||
dockerBinaryPath.setDisplayName(Tr::tr("Docker CLI"));
|
||||
dockerBinaryPath.setHistoryCompleter("Docker.Command.History");
|
||||
dockerBinaryPath.setLabelText(Tr::tr("Command:"));
|
||||
|
||||
Reference in New Issue
Block a user