forked from qt-creator/qt-creator
docker: Change Settings to single owner
We change DockerSettings to have a single owner. Since DockerDevices are destroyed after the plugin is unloaded, we have to make sure to remove the settings from devices during plugin teardown. For this we store a list of created devices in the factory, and call their shutdown function when the plugin unloads. Change-Id: Ic9c7d8ad9437c48d68f20c9a8f8ad7449b3cb972 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -47,7 +47,7 @@ DockerSettings::DockerSettings()
|
||||
registerAspect(&dockerBinaryPath);
|
||||
dockerBinaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||
dockerBinaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
||||
dockerBinaryPath.setDefaultValue(FilePath::fromString("docker").searchInPath().toString());
|
||||
dockerBinaryPath.setDefaultValue(FilePath::fromString("docker").searchInPath({"/usr/local/bin"}).toString());
|
||||
dockerBinaryPath.setDisplayName(tr("Docker CLI"));
|
||||
dockerBinaryPath.setHistoryCompleter("Docker.Command.History");
|
||||
dockerBinaryPath.setLabelText(tr("Command:"));
|
||||
@@ -58,14 +58,14 @@ DockerSettings::DockerSettings()
|
||||
|
||||
// DockerSettingsPage
|
||||
|
||||
DockerSettingsPage::DockerSettingsPage(QSharedPointer<DockerSettings> settings)
|
||||
DockerSettingsPage::DockerSettingsPage(DockerSettings *settings)
|
||||
{
|
||||
setId(Docker::Constants::DOCKER_SETTINGS_ID);
|
||||
setDisplayName(DockerSettings::tr("Docker"));
|
||||
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
|
||||
setSettings(settings.get());
|
||||
setSettings(settings);
|
||||
|
||||
setLayouter([settings = settings.get()](QWidget *widget) {
|
||||
setLayouter([settings](QWidget *widget) {
|
||||
DockerSettings &s = *settings;
|
||||
using namespace Layouting;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user