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
b9efb809
Commit
b9efb809
authored
Apr 19, 2010
by
Tobias Hunger
Browse files
Add some comments to environmentmodel::data()
Reviewed-by: dt
parent
dfad3fa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/environmenteditmodel.cpp
View file @
b9efb809
...
...
@@ -103,13 +103,14 @@ QVariant EnvironmentModel::data(const QModelIndex &index, int role) const
if
(
!
index
.
isValid
())
return
QVariant
();
if
(
(
role
==
Qt
::
DisplayRole
||
role
==
Qt
::
EditRole
)
)
{
if
(
role
==
Qt
::
DisplayRole
||
role
==
Qt
::
EditRole
)
{
if
(
index
.
column
()
==
0
)
{
return
m_resultEnvironment
.
key
(
m_resultEnvironment
.
constBegin
()
+
index
.
row
());
}
else
if
(
index
.
column
()
==
1
)
{
// Do not return "<UNSET>" when editing a previously unset variable:
if
(
role
==
Qt
::
EditRole
)
{
int
pos
=
findInChanges
(
indexToVariable
(
index
));
if
(
pos
!
=
-
1
)
if
(
pos
>
=
0
)
return
m_items
.
at
(
pos
).
value
;
}
return
m_resultEnvironment
.
value
(
m_resultEnvironment
.
constBegin
()
+
index
.
row
());
...
...
@@ -127,7 +128,6 @@ QVariant EnvironmentModel::data(const QModelIndex &index, int role) const
return
QVariant
();
}
Qt
::
ItemFlags
EnvironmentModel
::
flags
(
const
QModelIndex
&
index
)
const
{
Q_UNUSED
(
index
)
...
...
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