Skip to content
GitLab
Menu
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
78408861
Commit
78408861
authored
Feb 25, 2011
by
Tobias Hunger
Browse files
ToolChainOPtionsPage: Make sure parents are cleared
Make sure parent pointers are cleared when removing nodes.
parent
52007315
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/toolchainoptionspage.cpp
View file @
78408861
...
...
@@ -70,9 +70,14 @@ public:
~
ToolChainNode
()
{
if
(
parent
)
parent
->
childNodes
.
removeOne
(
this
);
qDeleteAll
(
childNodes
);
// Do not delete toolchain, we do not own it.
delete
widget
;
Q_ASSERT
(
childNodes
.
isEmpty
());
widget
->
deleteLater
();
}
ToolChainNode
*
parent
;
...
...
@@ -283,6 +288,7 @@ void ToolChainModel::apply()
// Remove unused ToolChains:
QList
<
ToolChainNode
*>
nodes
=
m_toRemoveList
;
foreach
(
ToolChainNode
*
n
,
nodes
)
{
Q_ASSERT
(
!
n
->
parent
);
ToolChainManager
::
instance
()
->
deregisterToolChain
(
n
->
toolChain
);
}
Q_ASSERT
(
m_toRemoveList
.
isEmpty
());
...
...
@@ -328,11 +334,13 @@ void ToolChainModel::markForRemoval(ToolChain *tc)
if
(
node
)
{
emit
beginRemoveRows
(
index
(
m_manualRoot
),
m_manualRoot
->
childNodes
.
indexOf
(
node
),
m_manualRoot
->
childNodes
.
indexOf
(
node
));
m_manualRoot
->
childNodes
.
removeOne
(
node
);
node
->
parent
=
0
;
if
(
m_toAddList
.
contains
(
node
))
{
delete
node
->
toolChain
;
node
->
toolChain
=
0
;
m_toAddList
.
removeOne
(
node
);
}
else
{
node
->
parent
=
0
;
m_toRemoveList
.
append
(
node
);
}
emit
endRemoveRows
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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