ProjectExplorer: Remove startRunControl()'s runMode parameter

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

Change-Id: Ia048b271a5003356d21f86a3f778827d23466037
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
hjk
2017-04-11 14:36:03 +02:00
parent ee27248a56
commit 5d97c4871a
10 changed files with 16 additions and 17 deletions

View File

@@ -346,9 +346,7 @@ void TestRunner::debugTests()
connect(this, &TestRunner::requestStopTestRun, runControl, &Debugger::DebuggerRunControl::stop); connect(this, &TestRunner::requestStopTestRun, runControl, &Debugger::DebuggerRunControl::stop);
connect(runControl, &Debugger::DebuggerRunControl::finished, this, &TestRunner::onFinished); connect(runControl, &Debugger::DebuggerRunControl::finished, this, &TestRunner::onFinished);
ProjectExplorer::ProjectExplorerPlugin::startRunControl( ProjectExplorer::ProjectExplorerPlugin::startRunControl(runControl);
runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE);
} }
void TestRunner::runOrDebugTests() void TestRunner::runOrDebugTests()

View File

@@ -2127,7 +2127,7 @@ void DebuggerPlugin::attachExternalApplication(RunControl *rc)
if (RunConfiguration *runConfig = rc->runConfiguration()) { if (RunConfiguration *runConfig = rc->runConfiguration()) {
auto runControl = new DebuggerRunControl(runConfig, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto runControl = new DebuggerRunControl(runConfig, ProjectExplorer::Constants::DEBUG_RUN_MODE);
(void) new DebuggerRunTool(runControl, rp); (void) new DebuggerRunTool(runControl, rp);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE); ProjectExplorerPlugin::startRunControl(runControl);
} else { } else {
createAndScheduleRun(rp, guessKitFromParameters(rp)); createAndScheduleRun(rp, guessKitFromParameters(rp));
} }
@@ -3712,7 +3712,7 @@ void DebuggerUnitTests::testStateMachine()
auto runControl = new DebuggerRunControl(rc, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto runControl = new DebuggerRunControl(rc, ProjectExplorer::Constants::DEBUG_RUN_MODE);
(void) new DebuggerRunTool(runControl, rp); (void) new DebuggerRunTool(runControl, rp);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE); ProjectExplorerPlugin::startRunControl(runControl);
connect(runControl, &RunControl::finished, this, [this] { connect(runControl, &RunControl::finished, this, [this] {
QTestEventLoop::instance().exitLoop(); QTestEventLoop::instance().exitLoop();

View File

@@ -674,7 +674,7 @@ RunControl *createAndScheduleRun(const DebuggerRunParameters &rp, Kit *kit)
auto runControl = new DebuggerRunControl(runConfig, DebugRunMode); auto runControl = new DebuggerRunControl(runConfig, DebugRunMode);
(void) new DebuggerRunTool(runControl, rp); (void) new DebuggerRunTool(runControl, rp);
QTC_ASSERT(runControl, return nullptr); QTC_ASSERT(runControl, return nullptr);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE); ProjectExplorerPlugin::startRunControl(runControl);
return runControl; return runControl;
} }

View File

@@ -3330,7 +3330,7 @@ void GdbEngine::handleMakeSnapshot(const DebuggerResponse &response, const QStri
rp.isSnapshot = true; rp.isSnapshot = true;
auto rc = new DebuggerRunControl(runControl()->runConfiguration(), ProjectExplorer::Constants::DEBUG_RUN_MODE); auto rc = new DebuggerRunControl(runControl()->runConfiguration(), ProjectExplorer::Constants::DEBUG_RUN_MODE);
(void) new DebuggerRunTool(rc, rp); (void) new DebuggerRunTool(rc, rp);
ProjectExplorerPlugin::startRunControl(rc, ProjectExplorer::Constants::DEBUG_RUN_MODE); ProjectExplorerPlugin::startRunControl(rc);
} else { } else {
QString msg = response.data["msg"].data(); QString msg = response.data["msg"].data();
AsynchronousMessageBox::critical(tr("Snapshot Creation Error"), AsynchronousMessageBox::critical(tr("Snapshot Creation Error"),

View File

@@ -283,7 +283,7 @@ public:
QPair<bool, QString> buildSettingsEnabled(const Project *pro); QPair<bool, QString> buildSettingsEnabled(const Project *pro);
void addToRecentProjects(const QString &fileName, const QString &displayName); void addToRecentProjects(const QString &fileName, const QString &displayName);
void startRunControl(RunControl *runControl, Core::Id runMode); void startRunControl(RunControl *runControl);
void updateActions(); void updateActions();
void updateContext(); void updateContext();
@@ -2005,7 +2005,7 @@ void ProjectExplorerPluginPrivate::executeRunConfiguration(RunConfiguration *run
m_instance->showRunErrorMessage(errorMessage); m_instance->showRunErrorMessage(errorMessage);
return; 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); 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->createNewOutputWindow(runControl);
m_outputPane->flash(); // one flash for starting m_outputPane->flash(); // one flash for starting
m_outputPane->showTabFor(runControl); m_outputPane->showTabFor(runControl);
Core::Id runMode = runControl->runMode();
bool popup = (runMode == Constants::NORMAL_RUN_MODE && dd->m_projectExplorerSettings.showRunOutput) 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) || ((runMode == Constants::DEBUG_RUN_MODE || runMode == Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN)
&& m_projectExplorerSettings.showDebugOutput); && m_projectExplorerSettings.showDebugOutput);

View File

@@ -127,7 +127,7 @@ public:
static void setProjectExplorerSettings(const Internal::ProjectExplorerSettings &pes); static void setProjectExplorerSettings(const Internal::ProjectExplorerSettings &pes);
static Internal::ProjectExplorerSettings projectExplorerSettings(); static Internal::ProjectExplorerSettings projectExplorerSettings();
static void startRunControl(RunControl *runControl, Core::Id runMode); static void startRunControl(RunControl *runControl);
static void showRunErrorMessage(const QString &errorMessage); static void showRunErrorMessage(const QString &errorMessage);
// internal public for FlatModel // internal public for FlatModel

View File

@@ -597,7 +597,7 @@ void QmlProfilerTool::startRemoteTool(ProjectExplorer::RunConfiguration *rc)
auto runControl = qobject_cast<QmlProfilerRunControl *>(createRunControl(rc)); auto runControl = qobject_cast<QmlProfilerRunControl *>(createRunControl(rc));
runControl->setConnection(connection); runControl->setConnection(connection);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE); ProjectExplorerPlugin::startRunControl(runControl);
} }
QString QmlProfilerTool::summary(const QVector<int> &typeIds) const QString QmlProfilerTool::summary(const QVector<int> &typeIds) const

View File

@@ -147,7 +147,7 @@ void QnxAttachDebugSupport::attachToProcess()
} }
connect(runControl, &Debugger::DebuggerRunControl::stateChanged, connect(runControl, &Debugger::DebuggerRunControl::stateChanged,
this, &QnxAttachDebugSupport::handleDebuggerStateChanged); this, &QnxAttachDebugSupport::handleDebuggerStateChanged);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE); ProjectExplorerPlugin::startRunControl(runControl);
} }
void QnxAttachDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state) void QnxAttachDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state)

View File

@@ -281,7 +281,7 @@ CallgrindTool::CallgrindTool(QObject *parent)
connection.connParams = dlg.sshParams(); connection.connParams = dlg.sshParams();
rc->setConnection(connection); rc->setConnection(connection);
rc->setDisplayName(runnable.executable); rc->setDisplayName(runnable.executable);
ProjectExplorerPlugin::startRunControl(rc, CALLGRIND_RUN_MODE); ProjectExplorerPlugin::startRunControl(rc);
}); });
desc.setMenuGroup(Debugger::Constants::G_ANALYZER_REMOTE_TOOLS); desc.setMenuGroup(Debugger::Constants::G_ANALYZER_REMOTE_TOOLS);
Debugger::registerAction(CallgrindRemoteActionId, desc); Debugger::registerAction(CallgrindRemoteActionId, desc);

View File

@@ -429,7 +429,7 @@ MemcheckTool::MemcheckTool(QObject *parent)
connection.connParams = dlg.sshParams(); connection.connParams = dlg.sshParams();
rc->setConnection(connection); rc->setConnection(connection);
rc->setDisplayName(runnable.executable); rc->setDisplayName(runnable.executable);
ProjectExplorerPlugin::startRunControl(rc, MEMCHECK_RUN_MODE); ProjectExplorerPlugin::startRunControl(rc);
}); });
desc.setMenuGroup(Debugger::Constants::G_ANALYZER_REMOTE_TOOLS); desc.setMenuGroup(Debugger::Constants::G_ANALYZER_REMOTE_TOOLS);
Debugger::registerAction("Memcheck.Remote", desc); Debugger::registerAction("Memcheck.Remote", desc);