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
12b0933d
Commit
12b0933d
authored
Apr 19, 2010
by
Tobias Hunger
Browse files
Rename some methods for consistency
Reviewed-by: dt
parent
dffb276e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/environmenteditmodel.cpp
View file @
12b0933d
...
...
@@ -218,7 +218,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
}
if
(
changes
(
old
.
name
))
re
move
Variable
(
old
.
name
);
re
set
Variable
(
old
.
name
);
old
.
name
=
newName
;
addVariable
(
old
);
emit
renamedVariable
(
newName
);
...
...
@@ -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
rowInChanges
=
findInChanges
(
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
);
// look in m_items for the variable
...
...
@@ -319,7 +319,7 @@ void EnvironmentModel::unset(const QString &name)
emit
userChangesChanged
();
}
bool
EnvironmentModel
::
is
Unset
(
const
QString
&
name
)
bool
EnvironmentModel
::
can
Unset
(
const
QString
&
name
)
{
int
pos
=
findInChanges
(
name
);
if
(
pos
!=
-
1
)
...
...
@@ -328,7 +328,7 @@ bool EnvironmentModel::isUnset(const QString &name)
return
false
;
}
bool
EnvironmentModel
::
isInBaseEnvironmen
t
(
const
QString
&
name
)
bool
EnvironmentModel
::
canRese
t
(
const
QString
&
name
)
{
return
m_baseEnvironment
.
hasKey
(
name
);
}
...
...
@@ -395,10 +395,10 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
m_addButton
->
setText
(
tr
(
"&Add"
));
buttonLayout
->
addWidget
(
m_addButton
);
m_re
move
Button
=
new
QPushButton
(
this
);
m_re
move
Button
->
setEnabled
(
false
);
m_re
move
Button
->
setText
(
tr
(
"&Reset"
));
buttonLayout
->
addWidget
(
m_re
move
Button
);
m_re
set
Button
=
new
QPushButton
(
this
);
m_re
set
Button
->
setEnabled
(
false
);
m_re
set
Button
->
setText
(
tr
(
"&Reset"
));
buttonLayout
->
addWidget
(
m_re
set
Button
);
m_unsetButton
=
new
QPushButton
(
this
);
m_unsetButton
->
setEnabled
(
false
);
...
...
@@ -419,7 +419,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
this
,
SLOT
(
editEnvironmentButtonClicked
()));
connect
(
m_addButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
addEnvironmentButtonClicked
()));
connect
(
m_re
move
Button
,
SIGNAL
(
clicked
(
bool
)),
connect
(
m_re
set
Button
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
removeEnvironmentButtonClicked
()));
connect
(
m_unsetButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
unsetEnvironmentButtonClicked
()));
...
...
@@ -507,7 +507,7 @@ void EnvironmentWidget::addEnvironmentButtonClicked()
void
EnvironmentWidget
::
removeEnvironmentButtonClicked
()
{
const
QString
&
name
=
m_model
->
indexToVariable
(
m_environmentTreeView
->
currentIndex
());
m_model
->
re
move
Variable
(
name
);
m_model
->
re
set
Variable
(
name
);
updateButtons
();
}
...
...
@@ -516,10 +516,10 @@ void EnvironmentWidget::removeEnvironmentButtonClicked()
void
EnvironmentWidget
::
unsetEnvironmentButtonClicked
()
{
const
QString
&
name
=
m_model
->
indexToVariable
(
m_environmentTreeView
->
currentIndex
());
if
(
!
m_model
->
isInBaseEnvironmen
t
(
name
))
m_model
->
re
move
Variable
(
name
);
if
(
!
m_model
->
canRese
t
(
name
))
m_model
->
re
set
Variable
(
name
);
else
m_model
->
unset
(
name
);
m_model
->
unset
Variable
(
name
);
updateButtons
();
}
...
...
@@ -529,13 +529,13 @@ void EnvironmentWidget::environmentCurrentIndexChanged(const QModelIndex ¤
if
(
current
.
isValid
())
{
m_editButton
->
setEnabled
(
true
);
const
QString
&
name
=
m_model
->
indexToVariable
(
current
);
bool
modified
=
m_model
->
isInBaseEnvironmen
t
(
name
)
&&
m_model
->
changes
(
name
);
bool
unset
=
m_model
->
is
Unset
(
name
);
m_re
move
Button
->
setEnabled
(
modified
||
unset
);
bool
modified
=
m_model
->
canRese
t
(
name
)
&&
m_model
->
changes
(
name
);
bool
unset
=
m_model
->
can
Unset
(
name
);
m_re
set
Button
->
setEnabled
(
modified
||
unset
);
m_unsetButton
->
setEnabled
(
!
unset
);
}
else
{
m_editButton
->
setEnabled
(
false
);
m_re
move
Button
->
setEnabled
(
false
);
m_re
set
Button
->
setEnabled
(
false
);
m_unsetButton
->
setEnabled
(
false
);
}
}
src/plugins/projectexplorer/environmenteditmodel.h
View file @
12b0933d
...
...
@@ -63,10 +63,10 @@ public:
QModelIndex
addVariable
();
QModelIndex
addVariable
(
const
EnvironmentItem
&
item
);
void
re
move
Variable
(
const
QString
&
name
);
void
unset
(
const
QString
&
name
);
bool
is
Unset
(
const
QString
&
name
);
bool
isInBaseEnvironmen
t
(
const
QString
&
name
);
void
re
set
Variable
(
const
QString
&
name
);
void
unset
Variable
(
const
QString
&
name
);
bool
can
Unset
(
const
QString
&
name
);
bool
canRese
t
(
const
QString
&
name
);
QString
indexToVariable
(
const
QModelIndex
&
index
)
const
;
QModelIndex
variableToIndex
(
const
QString
&
name
)
const
;
bool
changes
(
const
QString
&
key
)
const
;
...
...
@@ -132,7 +132,7 @@ private:
QTreeView
*
m_environmentTreeView
;
QPushButton
*
m_editButton
;
QPushButton
*
m_addButton
;
QPushButton
*
m_re
move
Button
;
QPushButton
*
m_re
set
Button
;
QPushButton
*
m_unsetButton
;
};
...
...
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