aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/boot2qt
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-06-29 18:12:48 +0200
committerhjk <hjk@qt.io>2023-07-04 13:21:24 +0000
commit941c99c893837485ab97fbe711063683dd943b94 (patch)
treefb92d0c44844ce96a391cfb9cca46b44801857d8 /src/plugins/boot2qt
parentd0d1e1af1f148c820637ae3d79d9632659b13fbe (diff)
Boot2Qt: Use direct aspect registration in QdbMakeDefaultAppStep
Task-number: QTCREATORBUG-29168 Change-Id: I06c28f864cc9a517cfb8183ef2dfa366310438df Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/boot2qt')
-rw-r--r--src/plugins/boot2qt/qdbmakedefaultappstep.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/plugins/boot2qt/qdbmakedefaultappstep.cpp b/src/plugins/boot2qt/qdbmakedefaultappstep.cpp
index ae5806deb9..b02beff530 100644
--- a/src/plugins/boot2qt/qdbmakedefaultappstep.cpp
+++ b/src/plugins/boot2qt/qdbmakedefaultappstep.cpp
@@ -28,15 +28,11 @@ public:
QdbMakeDefaultAppStep(BuildStepList *bsl, Id id)
: AbstractRemoteLinuxDeployStep(bsl, id)
{
- auto selection = addAspect<SelectionAspect>();
- selection->setSettingsKey("QdbMakeDefaultDeployStep.MakeDefault");
- selection->addOption(Tr::tr("Set this application to start by default"));
- selection->addOption(Tr::tr("Reset default application"));
+ selection.setSettingsKey("QdbMakeDefaultDeployStep.MakeDefault");
+ selection.addOption(Tr::tr("Set this application to start by default"));
+ selection.addOption(Tr::tr("Reset default application"));
- setInternalInitializer([this, selection] {
- m_makeDefault = selection->value() == 0;
- return isDeploymentPossible();
- });
+ setInternalInitializer([this] { return isDeploymentPossible(); });
}
private:
@@ -49,7 +45,7 @@ private:
remoteExe = exeAspect->executable().nativePath();
}
CommandLine cmd{deviceConfiguration()->filePath(Constants::AppcontrollerFilepath)};
- if (m_makeDefault && !remoteExe.isEmpty())
+ if (selection() == 0 && !remoteExe.isEmpty())
cmd.addArgs({"--make-default", remoteExe});
else
cmd.addArg("--remove-default");
@@ -60,7 +56,7 @@ private:
});
};
const auto doneHandler = [this](const Process &) {
- if (m_makeDefault)
+ if (selection() == 0)
addProgressMessage(Tr::tr("Application set as the default one."));
else
addProgressMessage(Tr::tr("Reset the default application."));
@@ -71,7 +67,7 @@ private:
return Group { ProcessTask(setupHandler, doneHandler, errorHandler) };
}
- bool m_makeDefault = true;
+ SelectionAspect selection{this};
};
// QdbMakeDefaultAppStepFactory