Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
5a5b1ca5
Commit
5a5b1ca5
authored
Jun 15, 2009
by
con
Browse files
qSharedPointerCast -> qSharedPointerDynamicCast
Especially in the canRun methods this is essential. Reviewed-by: dt
parent
36fc7f16
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerrunner.cpp
View file @
5a5b1ca5
...
...
@@ -65,7 +65,7 @@ DebuggerRunner::DebuggerRunner(DebuggerManager *manager) :
bool
DebuggerRunner
::
canRun
(
RunConfigurationPtr
runConfiguration
,
const
QString
&
mode
)
{
return
mode
==
ProjectExplorer
::
Constants
::
DEBUGMODE
&&
!
qSharedPointer
Cast
<
ApplicationRunConfiguration
>
(
runConfiguration
).
isNull
();
&&
!
runConfiguration
.
dynamic
Cast
<
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
=
qSharedPointer
Cast
<
ApplicationRunConfiguration
>
(
runConfiguration
);
//QTC
_ASSERT(rc
, return 0
);
runConfiguration
.
dynamic
Cast
<
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
=
qSharedPointer
Cast
<
ApplicationRunConfiguration
>
(
runConfiguration
()
);
runConfiguration
().
dynamic
Cast
<
ApplicationRunConfiguration
>
();
if
(
rc
)
{
// Enhance parameters by info from the project, but do not clobber
// arguments given in the dialogs
...
...
src/plugins/projectexplorer/applicationrunconfiguration.cpp
View file @
5a5b1ca5
...
...
@@ -81,7 +81,7 @@ ApplicationRunConfigurationRunner::~ApplicationRunConfigurationRunner()
bool
ApplicationRunConfigurationRunner
::
canRun
(
QSharedPointer
<
RunConfiguration
>
runConfiguration
,
const
QString
&
mode
)
{
return
(
mode
==
ProjectExplorer
::
Constants
::
RUNMODE
)
&&
(
!
qSharedPointer
Cast
<
ApplicationRunConfiguration
>
(
runConfiguration
).
isNull
());
&&
(
!
runConfiguration
.
dynamic
Cast
<
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
=
qSharedPointer
Cast
<
ApplicationRunConfiguration
>
(
runConfiguration
);
Q_ASSERT
(
rc
);
QSharedPointer
<
ApplicationRunConfiguration
>
rc
=
runConfiguration
.
dynamic
Cast
<
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
=
qSharedPointer
Cast
<
ApplicationRunConfiguration
>
(
runConfiguration
()
);
Q_ASSERT
(
rc
);
QSharedPointer
<
ApplicationRunConfiguration
>
rc
=
runConfiguration
().
dynamic
Cast
<
ApplicationRunConfiguration
>
();
Q_ASSERT
(
!
rc
.
isNull
()
);
m_applicationLauncher
.
setEnvironment
(
rc
->
environment
().
toStringList
());
m_applicationLauncher
.
setWorkingDirectory
(
rc
->
workingDirectory
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment