Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
12b0933d
Commit
12b0933d
authored
15 years ago
by
Tobias Hunger
Browse files
Options
Downloads
Patches
Plain Diff
Rename some methods for consistency
Reviewed-by: dt
parent
dffb276e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/projectexplorer/environmenteditmodel.cpp
+18
-18
18 additions, 18 deletions
src/plugins/projectexplorer/environmenteditmodel.cpp
src/plugins/projectexplorer/environmenteditmodel.h
+5
-5
5 additions, 5 deletions
src/plugins/projectexplorer/environmenteditmodel.h
with
23 additions
and
23 deletions
src/plugins/projectexplorer/environmenteditmodel.cpp
+
18
−
18
View file @
12b0933d
...
@@ -218,7 +218,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
...
@@ -218,7 +218,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
}
}
if
(
changes
(
old
.
name
))
if
(
changes
(
old
.
name
))
re
move
Variable
(
old
.
name
);
re
set
Variable
(
old
.
name
);
old
.
name
=
newName
;
old
.
name
=
newName
;
addVariable
(
old
);
addVariable
(
old
);
emit
renamedVariable
(
newName
);
emit
renamedVariable
(
newName
);
...
@@ -280,7 +280,7 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
...
@@ -280,7 +280,7 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
}
}
}
}
void
EnvironmentModel
::
re
move
Variable
(
const
QString
&
name
)
void
EnvironmentModel
::
re
set
Variable
(
const
QString
&
name
)
{
{
int
rowInResult
=
findInResult
(
name
);
int
rowInResult
=
findInResult
(
name
);
int
rowInChanges
=
findInChanges
(
name
);
int
rowInChanges
=
findInChanges
(
name
);
...
@@ -299,7 +299,7 @@ void EnvironmentModel::removeVariable(const QString &name)
...
@@ -299,7 +299,7 @@ void EnvironmentModel::removeVariable(const QString &name)
}
}
}
}
void
EnvironmentModel
::
unset
(
const
QString
&
name
)
void
EnvironmentModel
::
unset
Variable
(
const
QString
&
name
)
{
{
int
row
=
findInResult
(
name
);
int
row
=
findInResult
(
name
);
// look in m_items for the variable
// look in m_items for the variable
...
@@ -319,7 +319,7 @@ void EnvironmentModel::unset(const QString &name)
...
@@ -319,7 +319,7 @@ void EnvironmentModel::unset(const QString &name)
emit
userChangesChanged
();
emit
userChangesChanged
();
}
}
bool
EnvironmentModel
::
is
Unset
(
const
QString
&
name
)
bool
EnvironmentModel
::
can
Unset
(
const
QString
&
name
)
{
{
int
pos
=
findInChanges
(
name
);
int
pos
=
findInChanges
(
name
);
if
(
pos
!=
-
1
)
if
(
pos
!=
-
1
)
...
@@ -328,7 +328,7 @@ bool EnvironmentModel::isUnset(const QString &name)
...
@@ -328,7 +328,7 @@ bool EnvironmentModel::isUnset(const QString &name)
return
false
;
return
false
;
}
}
bool
EnvironmentModel
::
isInBaseEnvironmen
t
(
const
QString
&
name
)
bool
EnvironmentModel
::
canRese
t
(
const
QString
&
name
)
{
{
return
m_baseEnvironment
.
hasKey
(
name
);
return
m_baseEnvironment
.
hasKey
(
name
);
}
}
...
@@ -395,10 +395,10 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
...
@@ -395,10 +395,10 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
m_addButton
->
setText
(
tr
(
"&Add"
));
m_addButton
->
setText
(
tr
(
"&Add"
));
buttonLayout
->
addWidget
(
m_addButton
);
buttonLayout
->
addWidget
(
m_addButton
);
m_re
move
Button
=
new
QPushButton
(
this
);
m_re
set
Button
=
new
QPushButton
(
this
);
m_re
move
Button
->
setEnabled
(
false
);
m_re
set
Button
->
setEnabled
(
false
);
m_re
move
Button
->
setText
(
tr
(
"&Reset"
));
m_re
set
Button
->
setText
(
tr
(
"&Reset"
));
buttonLayout
->
addWidget
(
m_re
move
Button
);
buttonLayout
->
addWidget
(
m_re
set
Button
);
m_unsetButton
=
new
QPushButton
(
this
);
m_unsetButton
=
new
QPushButton
(
this
);
m_unsetButton
->
setEnabled
(
false
);
m_unsetButton
->
setEnabled
(
false
);
...
@@ -419,7 +419,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
...
@@ -419,7 +419,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
this
,
SLOT
(
editEnvironmentButtonClicked
()));
this
,
SLOT
(
editEnvironmentButtonClicked
()));
connect
(
m_addButton
,
SIGNAL
(
clicked
(
bool
)),
connect
(
m_addButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
addEnvironmentButtonClicked
()));
this
,
SLOT
(
addEnvironmentButtonClicked
()));
connect
(
m_re
move
Button
,
SIGNAL
(
clicked
(
bool
)),
connect
(
m_re
set
Button
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
removeEnvironmentButtonClicked
()));
this
,
SLOT
(
removeEnvironmentButtonClicked
()));
connect
(
m_unsetButton
,
SIGNAL
(
clicked
(
bool
)),
connect
(
m_unsetButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
unsetEnvironmentButtonClicked
()));
this
,
SLOT
(
unsetEnvironmentButtonClicked
()));
...
@@ -507,7 +507,7 @@ void EnvironmentWidget::addEnvironmentButtonClicked()
...
@@ -507,7 +507,7 @@ void EnvironmentWidget::addEnvironmentButtonClicked()
void
EnvironmentWidget
::
removeEnvironmentButtonClicked
()
void
EnvironmentWidget
::
removeEnvironmentButtonClicked
()
{
{
const
QString
&
name
=
m_model
->
indexToVariable
(
m_environmentTreeView
->
currentIndex
());
const
QString
&
name
=
m_model
->
indexToVariable
(
m_environmentTreeView
->
currentIndex
());
m_model
->
re
move
Variable
(
name
);
m_model
->
re
set
Variable
(
name
);
updateButtons
();
updateButtons
();
}
}
...
@@ -516,10 +516,10 @@ void EnvironmentWidget::removeEnvironmentButtonClicked()
...
@@ -516,10 +516,10 @@ void EnvironmentWidget::removeEnvironmentButtonClicked()
void
EnvironmentWidget
::
unsetEnvironmentButtonClicked
()
void
EnvironmentWidget
::
unsetEnvironmentButtonClicked
()
{
{
const
QString
&
name
=
m_model
->
indexToVariable
(
m_environmentTreeView
->
currentIndex
());
const
QString
&
name
=
m_model
->
indexToVariable
(
m_environmentTreeView
->
currentIndex
());
if
(
!
m_model
->
isInBaseEnvironmen
t
(
name
))
if
(
!
m_model
->
canRese
t
(
name
))
m_model
->
re
move
Variable
(
name
);
m_model
->
re
set
Variable
(
name
);
else
else
m_model
->
unset
(
name
);
m_model
->
unset
Variable
(
name
);
updateButtons
();
updateButtons
();
}
}
...
@@ -529,13 +529,13 @@ void EnvironmentWidget::environmentCurrentIndexChanged(const QModelIndex ¤
...
@@ -529,13 +529,13 @@ void EnvironmentWidget::environmentCurrentIndexChanged(const QModelIndex ¤
if
(
current
.
isValid
())
{
if
(
current
.
isValid
())
{
m_editButton
->
setEnabled
(
true
);
m_editButton
->
setEnabled
(
true
);
const
QString
&
name
=
m_model
->
indexToVariable
(
current
);
const
QString
&
name
=
m_model
->
indexToVariable
(
current
);
bool
modified
=
m_model
->
isInBaseEnvironmen
t
(
name
)
&&
m_model
->
changes
(
name
);
bool
modified
=
m_model
->
canRese
t
(
name
)
&&
m_model
->
changes
(
name
);
bool
unset
=
m_model
->
is
Unset
(
name
);
bool
unset
=
m_model
->
can
Unset
(
name
);
m_re
move
Button
->
setEnabled
(
modified
||
unset
);
m_re
set
Button
->
setEnabled
(
modified
||
unset
);
m_unsetButton
->
setEnabled
(
!
unset
);
m_unsetButton
->
setEnabled
(
!
unset
);
}
else
{
}
else
{
m_editButton
->
setEnabled
(
false
);
m_editButton
->
setEnabled
(
false
);
m_re
move
Button
->
setEnabled
(
false
);
m_re
set
Button
->
setEnabled
(
false
);
m_unsetButton
->
setEnabled
(
false
);
m_unsetButton
->
setEnabled
(
false
);
}
}
}
}
This diff is collapsed.
Click to expand it.
src/plugins/projectexplorer/environmenteditmodel.h
+
5
−
5
View file @
12b0933d
...
@@ -63,10 +63,10 @@ public:
...
@@ -63,10 +63,10 @@ public:
QModelIndex
addVariable
();
QModelIndex
addVariable
();
QModelIndex
addVariable
(
const
EnvironmentItem
&
item
);
QModelIndex
addVariable
(
const
EnvironmentItem
&
item
);
void
re
move
Variable
(
const
QString
&
name
);
void
re
set
Variable
(
const
QString
&
name
);
void
unset
(
const
QString
&
name
);
void
unset
Variable
(
const
QString
&
name
);
bool
is
Unset
(
const
QString
&
name
);
bool
can
Unset
(
const
QString
&
name
);
bool
isInBaseEnvironmen
t
(
const
QString
&
name
);
bool
canRese
t
(
const
QString
&
name
);
QString
indexToVariable
(
const
QModelIndex
&
index
)
const
;
QString
indexToVariable
(
const
QModelIndex
&
index
)
const
;
QModelIndex
variableToIndex
(
const
QString
&
name
)
const
;
QModelIndex
variableToIndex
(
const
QString
&
name
)
const
;
bool
changes
(
const
QString
&
key
)
const
;
bool
changes
(
const
QString
&
key
)
const
;
...
@@ -132,7 +132,7 @@ private:
...
@@ -132,7 +132,7 @@ private:
QTreeView
*
m_environmentTreeView
;
QTreeView
*
m_environmentTreeView
;
QPushButton
*
m_editButton
;
QPushButton
*
m_editButton
;
QPushButton
*
m_addButton
;
QPushButton
*
m_addButton
;
QPushButton
*
m_re
move
Button
;
QPushButton
*
m_re
set
Button
;
QPushButton
*
m_unsetButton
;
QPushButton
*
m_unsetButton
;
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment