forked from qt-creator/qt-creator
ProjectExplorer: Add runStartupProject() convenience function
The usage pattern seems to be used often enough to justify a function. Change-Id: Iecdeb2b42879f419154902e685d0d13e8cae8b33 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -709,9 +709,6 @@ public:
|
||||
void showSettingsDialog();
|
||||
void updateDebugWithoutDeployMenu();
|
||||
|
||||
void debugProject();
|
||||
void debugProjectWithoutDeploy();
|
||||
void debugProjectBreakMain();
|
||||
void startAndDebugApplication();
|
||||
void startRemoteCdbSession();
|
||||
void startRemoteServer();
|
||||
@@ -819,7 +816,7 @@ public slots:
|
||||
void handleExecStep()
|
||||
{
|
||||
if (currentEngine()->state() == DebuggerNotReady) {
|
||||
debugProjectBreakMain();
|
||||
ProjectExplorerPlugin::runStartupProject(DebugRunModeWithBreakOnMain);
|
||||
} else {
|
||||
currentEngine()->resetLocation();
|
||||
if (boolSetting(OperateByInstruction))
|
||||
@@ -832,7 +829,7 @@ public slots:
|
||||
void handleExecNext()
|
||||
{
|
||||
if (currentEngine()->state() == DebuggerNotReady) {
|
||||
debugProjectBreakMain();
|
||||
ProjectExplorerPlugin::runStartupProject(DebugRunModeWithBreakOnMain);
|
||||
} else {
|
||||
currentEngine()->resetLocation();
|
||||
if (boolSetting(OperateByInstruction))
|
||||
@@ -1327,21 +1324,6 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
|
||||
setProxyAction(m_visibleStartAction, Id(Constants::DEBUG));
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::debugProject()
|
||||
{
|
||||
ProjectExplorerPlugin::runProject(SessionManager::startupProject(), DebugRunMode);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::debugProjectWithoutDeploy()
|
||||
{
|
||||
ProjectExplorerPlugin::runProject(SessionManager::startupProject(), DebugRunMode, true);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::debugProjectBreakMain()
|
||||
{
|
||||
ProjectExplorerPlugin::runProject(SessionManager::startupProject(), DebugRunModeWithBreakOnMain);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::startAndDebugApplication()
|
||||
{
|
||||
DebuggerStartParameters sp;
|
||||
@@ -2652,11 +2634,11 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
||||
debuggerIcon.addFile(QLatin1String(":/projectexplorer/images/debugger_start.png"));
|
||||
act->setIcon(debuggerIcon);
|
||||
act->setText(tr("Start Debugging"));
|
||||
connect(act, &QAction::triggered, this, &DebuggerPluginPrivate::debugProject);
|
||||
connect(act, &QAction::triggered, [] { ProjectExplorerPlugin::runStartupProject(DebugRunMode); });
|
||||
|
||||
act = m_debugWithoutDeployAction = new QAction(this);
|
||||
act->setText(tr("Start Debugging Without Deployment"));
|
||||
connect(act, &QAction::triggered, this, &DebuggerPluginPrivate::debugProjectWithoutDeploy);
|
||||
connect(act, &QAction::triggered, [] { ProjectExplorerPlugin::runStartupProject(DebugRunMode, true); });
|
||||
|
||||
act = m_startAndDebugApplicationAction = new QAction(this);
|
||||
act->setText(tr("Start and Debug External Application..."));
|
||||
|
@@ -2256,12 +2256,12 @@ void ProjectExplorerPlugin::cleanSession()
|
||||
|
||||
void ProjectExplorerPlugin::runProject()
|
||||
{
|
||||
runProject(SessionManager::startupProject(), NormalRunMode);
|
||||
runStartupProject(NormalRunMode);
|
||||
}
|
||||
|
||||
void ProjectExplorerPlugin::runProjectWithoutDeploy()
|
||||
{
|
||||
runProject(SessionManager::startupProject(), NormalRunMode, true);
|
||||
runStartupProject(NormalRunMode, true);
|
||||
}
|
||||
|
||||
void ProjectExplorerPlugin::runProjectContextMenu()
|
||||
@@ -2390,6 +2390,11 @@ void ProjectExplorerPlugin::runProject(Project *pro, RunMode mode, const bool fo
|
||||
runRunConfiguration(rc, mode, forceSkipDeploy);
|
||||
}
|
||||
|
||||
void ProjectExplorerPlugin::runStartupProject(RunMode runMode, bool forceSkipDeploy)
|
||||
{
|
||||
runProject(SessionManager::startupProject(), runMode, forceSkipDeploy);
|
||||
}
|
||||
|
||||
void ProjectExplorerPlugin::runRunConfiguration(RunConfiguration *rc,
|
||||
RunMode runMode,
|
||||
const bool forceSkipDeploy)
|
||||
|
@@ -99,6 +99,7 @@ public:
|
||||
|
||||
static bool canRun(Project *pro, RunMode runMode, QString *whyNot = 0);
|
||||
static void runProject(Project *pro, RunMode, const bool forceSkipDeploy = false);
|
||||
static void runStartupProject(RunMode runMode, bool forceSkipDeploy = false);
|
||||
static void runRunConfiguration(RunConfiguration *rc, RunMode runMode,
|
||||
const bool forceSkipDeploy = false);
|
||||
|
||||
|
@@ -498,8 +498,7 @@ void QmlProfilerTool::startLocalTool()
|
||||
AnalyzerManager::showMode();
|
||||
|
||||
// ### not sure if we're supposed to check if the RunConFiguration isEnabled
|
||||
Project *pro = SessionManager::startupProject();
|
||||
ProjectExplorerPlugin::runProject(pro, QmlProfilerRunMode);
|
||||
ProjectExplorerPlugin::runStartupProject(QmlProfilerRunMode);
|
||||
}
|
||||
|
||||
void QmlProfilerTool::startRemoteTool()
|
||||
|
@@ -560,8 +560,7 @@ AnalyzerRunControl *CallgrindToolPrivate::createRunControl(const AnalyzerStartPa
|
||||
void CallgrindTool::startLocalTool()
|
||||
{
|
||||
if (checkForLocalStart(ReleaseMode)) {
|
||||
Project *pro = SessionManager::startupProject();
|
||||
ProjectExplorerPlugin::runProject(pro, CallgrindRunMode);
|
||||
ProjectExplorerPlugin::runStartupProject(CallgrindRunMode);
|
||||
d->setBusyCursor(true);
|
||||
}
|
||||
}
|
||||
|
@@ -599,10 +599,8 @@ void MemcheckTool::setBusyCursor(bool busy)
|
||||
|
||||
void MemcheckTool::startLocalTool()
|
||||
{
|
||||
if (checkForLocalStart(DebugMode)) {
|
||||
Project *pro = SessionManager::startupProject();
|
||||
ProjectExplorerPlugin::runProject(pro, MemcheckRunMode);
|
||||
}
|
||||
if (checkForLocalStart(DebugMode))
|
||||
ProjectExplorerPlugin::runStartupProject(MemcheckRunMode);
|
||||
}
|
||||
|
||||
void MemcheckTool::startRemoteTool()
|
||||
@@ -622,10 +620,8 @@ MemcheckWithGdbTool::MemcheckWithGdbTool(QObject *parent) :
|
||||
|
||||
void MemcheckWithGdbTool::startLocalTool()
|
||||
{
|
||||
if (checkForLocalStart(DebugMode)) {
|
||||
Project *pro = SessionManager::startupProject();
|
||||
ProjectExplorerPlugin::runProject(pro, MemcheckWithGdbRunMode);
|
||||
}
|
||||
if (checkForLocalStart(DebugMode))
|
||||
ProjectExplorerPlugin::runStartupProject(MemcheckWithGdbRunMode);
|
||||
}
|
||||
|
||||
void MemcheckWithGdbTool::startRemoteTool()
|
||||
|
Reference in New Issue
Block a user