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
bfb06191
Commit
bfb06191
authored
Dec 14, 2009
by
dt
Browse files
Propageate BC::displayNameChanged() to BuildConfigurationComboBox
Fixes one of the missing updates. More to come.
parent
52d07a9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/projectwindow.cpp
View file @
bfb06191
...
...
@@ -502,8 +502,11 @@ BuildConfigurationComboBox::BuildConfigurationComboBox(Project *p, QWidget *pare
addWidget
(
m_label
);
//m_comboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
foreach
(
BuildConfiguration
*
buildConfiguration
,
p
->
buildConfigurations
())
foreach
(
BuildConfiguration
*
buildConfiguration
,
p
->
buildConfigurations
())
{
m_comboBox
->
addItem
(
buildConfiguration
->
displayName
(),
QVariant
::
fromValue
(
buildConfiguration
));
connect
(
buildConfiguration
,
SIGNAL
(
displayNameChanged
()),
this
,
SLOT
(
displayNameChanged
()));
}
if
(
p
->
buildConfigurations
().
count
()
==
1
)
{
m_label
->
setText
(
m_comboBox
->
itemText
(
0
));
setCurrentWidget
(
m_label
);
...
...
@@ -531,15 +534,16 @@ BuildConfigurationComboBox::~BuildConfigurationComboBox()
}
void
BuildConfigurationComboBox
::
n
ameChanged
(
BuildConfiguration
*
bc
)
void
BuildConfigurationComboBox
::
displayN
ameChanged
()
{
const
int
index
(
buildConfigurationToIndex
(
bc
));
if
(
index
==
-
1
)
return
;
const
QString
&
displayName
=
bc
->
displayName
();
m_comboBox
->
setItemText
(
index
,
displayName
);
for
(
int
i
=
0
;
i
<
m_comboBox
->
count
();
++
i
)
{
BuildConfiguration
*
bc
=
m_comboBox
->
itemData
(
i
).
value
<
BuildConfiguration
*>
();
const
QString
&
displayName
=
bc
->
displayName
();
m_comboBox
->
setItemText
(
i
,
displayName
);
}
if
(
m_comboBox
->
count
()
==
1
)
m_label
->
setText
(
displayName
);
m_label
->
setText
(
m_comboBox
->
itemText
(
0
)
);
}
int
BuildConfigurationComboBox
::
buildConfigurationToIndex
(
BuildConfiguration
*
bc
)
...
...
@@ -568,6 +572,8 @@ void BuildConfigurationComboBox::addedBuildConfiguration(BuildConfiguration *bc)
if
(
m_comboBox
->
count
()
==
2
)
setCurrentWidget
(
m_comboBox
);
ignoreIndexChange
=
false
;
connect
(
bc
,
SIGNAL
(
displayNameChanged
()),
this
,
SLOT
(
displayNameChanged
()));
}
void
BuildConfigurationComboBox
::
removedBuildConfiguration
(
BuildConfiguration
*
bc
)
...
...
@@ -582,6 +588,8 @@ void BuildConfigurationComboBox::removedBuildConfiguration(BuildConfiguration *
setCurrentWidget
(
m_label
);
}
ignoreIndexChange
=
false
;
connect
(
bc
,
SIGNAL
(
displayNameChanged
()),
this
,
SLOT
(
displayNameChanged
()));
}
void
BuildConfigurationComboBox
::
changedIndex
(
int
newIndex
)
...
...
src/plugins/projectexplorer/projectwindow.h
View file @
bfb06191
...
...
@@ -95,7 +95,7 @@ public:
BuildConfigurationComboBox
(
ProjectExplorer
::
Project
*
p
,
QWidget
*
parent
=
0
);
~
BuildConfigurationComboBox
();
private
slots
:
void
n
ameChanged
(
BuildConfiguration
*
bc
);
void
displayN
ameChanged
();
void
activeConfigurationChanged
();
void
addedBuildConfiguration
(
ProjectExplorer
::
BuildConfiguration
*
bc
);
void
removedBuildConfiguration
(
ProjectExplorer
::
BuildConfiguration
*
bc
);
...
...
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