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
Tobias Hunger
qt-creator
Commits
f5d68d9c
Commit
f5d68d9c
authored
Dec 09, 2010
by
dt
Browse files
EnvironmentModel: Fix crash on clicking add twice
Task-Nr: QTCREATORBUG-3336
parent
cc75d11a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/environmenteditmodel.cpp
View file @
f5d68d9c
...
...
@@ -291,14 +291,13 @@ QModelIndex EnvironmentModel::addVariable()
QModelIndex
EnvironmentModel
::
addVariable
(
const
Utils
::
EnvironmentItem
&
item
)
{
int
insertPos
=
findInResultInsertPosition
(
item
.
name
);
// Return existing index if the name is already in the result set:
if
(
insertPos
<
m_resultEnvironment
.
size
()
&&
m_resultEnvironment
.
key
(
m_resultEnvironment
.
constBegin
()
+
insertPos
)
==
item
.
name
)
{
return
index
(
insertPos
,
0
,
QModelIndex
());
}
int
pos
=
findInResult
(
item
.
name
);
if
(
pos
<
m_resultEnvironment
.
size
())
return
index
(
pos
,
0
,
QModelIndex
());
int
insertPos
=
findInResultInsertPosition
(
item
.
name
);
int
changePos
=
findInChanges
(
item
.
name
);
if
(
m_baseEnvironment
.
hasKey
(
item
.
name
))
{
// We previously unset this!
...
...
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