Commit 5d97c487 authored by hjk's avatar hjk

ProjectExplorer: Remove startRunControl()'s runMode parameter

It is redundant, as a RunControl has a runMode() getter.

Change-Id: Ia048b271a5003356d21f86a3f778827d23466037
Reviewed-by: Ulf Hermann's avatarUlf Hermann <ulf.hermann@qt.io>
parent ee27248a
......@@ -346,9 +346,7 @@ void TestRunner::debugTests()
connect(this, &TestRunner::requestStopTestRun, runControl, &Debugger::DebuggerRunControl::stop);
connect(runControl, &Debugger::DebuggerRunControl::finished, this, &TestRunner::onFinished);
ProjectExplorer::ProjectExplorerPlugin::startRunControl(
runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE);
ProjectExplorer::ProjectExplorerPlugin::startRunControl(runControl);
}
void TestRunner::runOrDebugTests()
......
......@@ -2127,7 +2127,7 @@ void DebuggerPlugin::attachExternalApplication(RunControl *rc)
if (RunConfiguration *runConfig = rc->runConfiguration()) {
auto runControl = new DebuggerRunControl(runConfig, ProjectExplorer::Constants::DEBUG_RUN_MODE);
(void) new DebuggerRunTool(runControl, rp);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE);
ProjectExplorerPlugin::startRunControl(runControl);
} else {
createAndScheduleRun(rp, guessKitFromParameters(rp));
}
......@@ -3712,7 +3712,7 @@ void DebuggerUnitTests::testStateMachine()
auto runControl = new DebuggerRunControl(rc, ProjectExplorer::Constants::DEBUG_RUN_MODE);
(void) new DebuggerRunTool(runControl, rp);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE);
ProjectExplorerPlugin::startRunControl(runControl);
connect(runControl, &RunControl::finished, this, [this] {
QTestEventLoop::instance().exitLoop();
......
......@@ -674,7 +674,7 @@ RunControl *createAndScheduleRun(const DebuggerRunParameters &rp, Kit *kit)
auto runControl = new DebuggerRunControl(runConfig, DebugRunMode);
(void) new DebuggerRunTool(runControl, rp);
QTC_ASSERT(runControl, return nullptr);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE);
ProjectExplorerPlugin::startRunControl(runControl);
return runControl;
}
......
......@@ -3330,7 +3330,7 @@ void GdbEngine::handleMakeSnapshot(const DebuggerResponse &response, const QStri
rp.isSnapshot = true;
auto rc = new DebuggerRunControl(runControl()->runConfiguration(), ProjectExplorer::Constants::DEBUG_RUN_MODE);
(void) new DebuggerRunTool(rc, rp);
ProjectExplorerPlugin::startRunControl(rc, ProjectExplorer::Constants::DEBUG_RUN_MODE);
ProjectExplorerPlugin::startRunControl(rc);
} else {
QString msg = response.data["msg"].data();
AsynchronousMessageBox::critical(tr("Snapshot Creation Error"),
......
......@@ -283,7 +283,7 @@ public:
QPair<bool, QString> buildSettingsEnabled(const Project *pro);
void addToRecentProjects(const QString &fileName, const QString &displayName);
void startRunControl(RunControl *runControl, Core::Id runMode);
void startRunControl(RunControl *runControl);
void updateActions();
void updateContext();
......@@ -2005,7 +2005,7 @@ void ProjectExplorerPluginPrivate::executeRunConfiguration(RunConfiguration *run
m_instance->showRunErrorMessage(errorMessage);
return;
}
startRunControl(control, runMode);
startRunControl(control);
}
}
......@@ -2017,16 +2017,17 @@ void ProjectExplorerPlugin::showRunErrorMessage(const QString &errorMessage)
QMessageBox::critical(ICore::mainWindow(), errorMessage.isNull() ? tr("Unknown error") : tr("Could Not Run"), errorMessage);
}
void ProjectExplorerPlugin::startRunControl(RunControl *runControl, Core::Id runMode)
void ProjectExplorerPlugin::startRunControl(RunControl *runControl)
{
dd->startRunControl(runControl, runMode);
dd->startRunControl(runControl);
}
void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl, Core::Id runMode)
void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl)
{
m_outputPane->createNewOutputWindow(runControl);
m_outputPane->flash(); // one flash for starting
m_outputPane->showTabFor(runControl);
Core::Id runMode = runControl->runMode();
bool popup = (runMode == Constants::NORMAL_RUN_MODE && dd->m_projectExplorerSettings.showRunOutput)
|| ((runMode == Constants::DEBUG_RUN_MODE || runMode == Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN)
&& m_projectExplorerSettings.showDebugOutput);
......
......@@ -127,7 +127,7 @@ public:
static void setProjectExplorerSettings(const Internal::ProjectExplorerSettings &pes);
static Internal::ProjectExplorerSettings projectExplorerSettings();
static void startRunControl(RunControl *runControl, Core::Id runMode);
static void startRunControl(RunControl *runControl);
static void showRunErrorMessage(const QString &errorMessage);
// internal public for FlatModel
......
......@@ -597,7 +597,7 @@ void QmlProfilerTool::startRemoteTool(ProjectExplorer::RunConfiguration *rc)
auto runControl = qobject_cast<QmlProfilerRunControl *>(createRunControl(rc));
runControl->setConnection(connection);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
ProjectExplorerPlugin::startRunControl(runControl);
}
QString QmlProfilerTool::summary(const QVector<int> &typeIds) const
......
......@@ -147,7 +147,7 @@ void QnxAttachDebugSupport::attachToProcess()
}
connect(runControl, &Debugger::DebuggerRunControl::stateChanged,
this, &QnxAttachDebugSupport::handleDebuggerStateChanged);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE);
ProjectExplorerPlugin::startRunControl(runControl);
}
void QnxAttachDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state)
......
......@@ -281,7 +281,7 @@ CallgrindTool::CallgrindTool(QObject *parent)
connection.connParams = dlg.sshParams();
rc->setConnection(connection);
rc->setDisplayName(runnable.executable);
ProjectExplorerPlugin::startRunControl(rc, CALLGRIND_RUN_MODE);
ProjectExplorerPlugin::startRunControl(rc);
});
desc.setMenuGroup(Debugger::Constants::G_ANALYZER_REMOTE_TOOLS);
Debugger::registerAction(CallgrindRemoteActionId, desc);
......
......@@ -429,7 +429,7 @@ MemcheckTool::MemcheckTool(QObject *parent)
connection.connParams = dlg.sshParams();
rc->setConnection(connection);
rc->setDisplayName(runnable.executable);
ProjectExplorerPlugin::startRunControl(rc, MEMCHECK_RUN_MODE);
ProjectExplorerPlugin::startRunControl(rc);
});
desc.setMenuGroup(Debugger::Constants::G_ANALYZER_REMOTE_TOOLS);
Debugger::registerAction("Memcheck.Remote", desc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment