Commit 5a5b1ca5 authored by con's avatar con
Browse files

qSharedPointerCast -> qSharedPointerDynamicCast

Especially in the canRun methods this is essential.

Reviewed-by: dt
parent 36fc7f16
......@@ -65,7 +65,7 @@ DebuggerRunner::DebuggerRunner(DebuggerManager *manager) :
bool DebuggerRunner::canRun(RunConfigurationPtr runConfiguration, const QString &mode)
{
return mode == ProjectExplorer::Constants::DEBUGMODE
&& !qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration).isNull();
&& !runConfiguration.dynamicCast<ApplicationRunConfiguration>().isNull();
}
QString DebuggerRunner::displayName() const
......@@ -80,8 +80,8 @@ RunControl* DebuggerRunner::run(RunConfigurationPtr runConfiguration,
{
QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0);
ApplicationRunConfigurationPtr rc =
qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration);
//QTC_ASSERT(rc, return 0);
runConfiguration.dynamicCast<ApplicationRunConfiguration>();
Q_ASSERT(!rc.isNull());
//qDebug() << "***** Debugging" << rc->name() << rc->executable();
DebuggerRunControl *runControl = new DebuggerRunControl(m_manager, startMode, sp, rc);
return runControl;
......@@ -137,7 +137,7 @@ void DebuggerRunControl::start()
{
m_running = true;
ApplicationRunConfigurationPtr rc =
qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration());
runConfiguration().dynamicCast<ApplicationRunConfiguration>();
if (rc) {
// Enhance parameters by info from the project, but do not clobber
// arguments given in the dialogs
......
......@@ -81,7 +81,7 @@ ApplicationRunConfigurationRunner::~ApplicationRunConfigurationRunner()
bool ApplicationRunConfigurationRunner::canRun(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
{
return (mode == ProjectExplorer::Constants::RUNMODE)
&& (!qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration).isNull());
&& (!runConfiguration.dynamicCast<ApplicationRunConfiguration>().isNull());
}
QString ApplicationRunConfigurationRunner::displayName() const
......@@ -91,8 +91,8 @@ QString ApplicationRunConfigurationRunner::displayName() const
RunControl *ApplicationRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
{
QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration);
Q_ASSERT(rc);
QSharedPointer<ApplicationRunConfiguration> rc = runConfiguration.dynamicCast<ApplicationRunConfiguration>();
Q_ASSERT(!rc.isNull());
Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE);
ApplicationRunControl *runControl = new ApplicationRunControl(rc);
......@@ -126,8 +126,8 @@ ApplicationRunControl::~ApplicationRunControl()
void ApplicationRunControl::start()
{
QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration());
Q_ASSERT(rc);
QSharedPointer<ApplicationRunConfiguration> rc = runConfiguration().dynamicCast<ApplicationRunConfiguration>();
Q_ASSERT(!rc.isNull());
m_applicationLauncher.setEnvironment(rc->environment().toStringList());
m_applicationLauncher.setWorkingDirectory(rc->workingDirectory());
......
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