Skip to content
GitLab
Menu
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
30362e10
Commit
30362e10
authored
Sep 21, 2009
by
con
Browse files
Remove the build config display name method from Project
parent
21565b99
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/buildsettingspropertiespage.cpp
View file @
30362e10
...
...
@@ -31,6 +31,7 @@
#include "buildstep.h"
#include "buildstepspage.h"
#include "project.h"
#include "buildconfiguration.h"
#include <coreplugin/coreconstants.h>
#include <extensionsystem/pluginmanager.h>
...
...
@@ -188,7 +189,7 @@ void BuildSettingsWidget::buildConfigurationDisplayNameChanged(const QString &bu
{
for
(
int
i
=
0
;
i
<
m_buildConfigurationComboBox
->
count
();
++
i
)
{
if
(
m_buildConfigurationComboBox
->
itemData
(
i
).
toString
()
==
buildConfiguration
)
{
m_buildConfigurationComboBox
->
setItemText
(
i
,
m_project
->
displayNameFor
(
buildConfiguration
));
m_buildConfigurationComboBox
->
setItemText
(
i
,
m_project
->
buildConfiguration
(
buildConfiguration
)
->
displayName
()
);
break
;
}
}
...
...
@@ -220,7 +221,7 @@ void BuildSettingsWidget::updateBuildSettings()
// Add tree items
foreach
(
const
QString
&
buildConfiguration
,
m_project
->
buildConfigurations
())
{
m_buildConfigurationComboBox
->
addItem
(
m_project
->
displayNameFor
(
buildConfiguration
),
buildConfiguration
);
m_buildConfigurationComboBox
->
addItem
(
m_project
->
buildConfiguration
(
buildConfiguration
)
->
displayName
()
,
buildConfiguration
);
if
(
buildConfiguration
==
m_buildConfiguration
)
m_buildConfigurationComboBox
->
setCurrentIndex
(
m_buildConfigurationComboBox
->
count
()
-
1
);
}
...
...
@@ -273,7 +274,7 @@ void BuildSettingsWidget::createConfiguration()
// Check that we don't have a configuration with the same displayName
QStringList
displayNames
;
foreach
(
const
QString
&
bc
,
buildConfigurations
)
displayNames
<<
m_project
->
displayName
For
(
bc
);
displayNames
<<
m_project
->
buildConfiguration
(
bc
)
->
displayName
(
);
if
(
displayNames
.
contains
(
newDisplayName
))
{
int
i
=
2
;
...
...
@@ -325,7 +326,7 @@ void BuildSettingsWidget::cloneConfiguration(const QString &sourceConfiguration)
// Check that we don't have a configuration with the same displayName
QStringList
displayNames
;
foreach
(
const
QString
&
bc
,
buildConfigurations
)
displayNames
<<
m_project
->
displayName
For
(
bc
);
displayNames
<<
m_project
->
buildConfiguration
(
bc
)
->
displayName
(
);
if
(
displayNames
.
contains
(
newDisplayName
))
{
int
i
=
2
;
...
...
src/plugins/projectexplorer/project.cpp
View file @
30362e10
...
...
@@ -215,7 +215,7 @@ void Project::saveSettingsImpl(PersistentSettingsWriter &writer)
//save buildsettings
foreach
(
const
QString
&
buildConfigurationName
,
buildConfigurations
())
{
QMap
<
QString
,
QVariant
>
temp
=
getB
uildConfiguration
(
buildConfigurationName
)
->
toMap
();
b
uildConfiguration
(
buildConfigurationName
)
->
toMap
();
writer
.
saveValue
(
"buildConfiguration-"
+
buildConfigurationName
,
temp
);
}
...
...
@@ -297,7 +297,7 @@ bool Project::restoreSettingsImpl(PersistentSettingsReader &reader)
addBuildConfiguration
(
buildConfigurationName
);
QMap
<
QString
,
QVariant
>
temp
=
reader
.
restoreValue
(
"buildConfiguration-"
+
buildConfigurationName
).
toMap
();
getB
uildConfiguration
(
buildConfigurationName
)
->
setValuesFromMap
(
temp
);
b
uildConfiguration
(
buildConfigurationName
)
->
setValuesFromMap
(
temp
);
}
const
QList
<
IBuildStepFactory
*>
buildStepFactories
=
...
...
@@ -410,7 +410,7 @@ QVariant Project::value(const QString &name) const
return
QVariant
();
}
BuildConfiguration
*
Project
::
getB
uildConfiguration
(
const
QString
&
name
)
const
BuildConfiguration
*
Project
::
b
uildConfiguration
(
const
QString
&
name
)
const
{
for
(
int
i
=
0
;
i
!=
m_buildConfigurationValues
.
size
();
++
i
)
if
(
m_buildConfigurationValues
.
at
(
i
)
->
name
()
==
name
)
...
...
@@ -418,16 +418,16 @@ BuildConfiguration *Project::getBuildConfiguration(const QString &name) const
return
0
;
}
void
Project
::
setValue
(
const
QString
&
buildConfiguration
,
const
QString
&
name
,
const
QVariant
&
value
)
void
Project
::
setValue
(
const
QString
&
buildConfiguration
Name
,
const
QString
&
name
,
const
QVariant
&
value
)
{
BuildConfiguration
*
bc
=
getB
uildConfiguration
(
buildConfiguration
);
BuildConfiguration
*
bc
=
b
uildConfiguration
(
buildConfiguration
Name
);
Q_ASSERT
(
bc
);
bc
->
setValue
(
name
,
value
);
}
QVariant
Project
::
value
(
const
QString
&
buildConfiguration
,
const
QString
&
name
)
const
QVariant
Project
::
value
(
const
QString
&
buildConfiguration
Name
,
const
QString
&
name
)
const
{
BuildConfiguration
*
bc
=
getB
uildConfiguration
(
buildConfiguration
);
BuildConfiguration
*
bc
=
b
uildConfiguration
(
buildConfiguration
Name
);
if
(
bc
)
return
bc
->
value
(
name
);
else
...
...
@@ -502,27 +502,22 @@ EditorConfiguration *Project::editorConfiguration() const
return
m_editorConfiguration
;
}
QString
Project
::
displayNameFor
(
const
QString
&
buildConfiguration
)
{
return
getBuildConfiguration
(
buildConfiguration
)
->
displayName
();
}
void
Project
::
setDisplayNameFor
(
const
QString
&
buildConfiguration
,
const
QString
&
displayName
)
void
Project
::
setDisplayNameFor
(
const
QString
&
buildConfigurationName
,
const
QString
&
displayName
)
{
QStringList
displayNames
;
foreach
(
const
QString
&
bc
,
buildConfiguration
s
()
)
{
if
(
bc
!=
buildConfiguration
)
displayNames
<<
displayName
For
(
bc
);
foreach
(
BuildConfiguration
*
bc
,
m_
buildConfiguration
Values
)
{
if
(
bc
->
name
()
!=
buildConfiguration
Name
)
displayNames
<<
bc
->
displayName
(
);
}
if
(
displayNames
.
contains
(
displayName
))
{
int
i
=
2
;
while
(
displayNames
.
contains
(
displayName
+
QString
::
number
(
i
)))
++
i
;
getB
uildConfiguration
(
buildConfiguration
)
->
setDisplayName
(
displayName
+
QString
::
number
(
i
));
b
uildConfiguration
(
buildConfiguration
Name
)
->
setDisplayName
(
displayName
+
QString
::
number
(
i
));
}
else
{
getB
uildConfiguration
(
buildConfiguration
)
->
setDisplayName
(
displayName
);
b
uildConfiguration
(
buildConfiguration
Name
)
->
setDisplayName
(
displayName
);
}
emit
buildConfigurationDisplayNameChanged
(
buildConfiguration
);
emit
buildConfigurationDisplayNameChanged
(
buildConfiguration
Name
);
}
QByteArray
Project
::
predefinedMacros
(
const
QString
&
)
const
...
...
src/plugins/projectexplorer/project.h
View file @
30362e10
...
...
@@ -56,10 +56,7 @@ class Environment;
class
ProjectNode
;
class
PersistentSettingsWriter
;
class
PersistentSettingsReader
;
namespace
Internal
{
class
BuildConfiguration
;
}
class
PROJECTEXPLORER_EXPORT
Project
:
public
QObject
...
...
@@ -101,8 +98,8 @@ public:
void
addBuildConfiguration
(
const
QString
&
name
);
void
removeBuildConfiguration
(
const
QString
&
name
);
void
copyBuildConfiguration
(
const
QString
&
source
,
const
QString
&
dest
);
BuildConfiguration
*
buildConfiguration
(
const
QString
&
name
)
const
;
QStringList
buildConfigurations
()
const
;
QString
displayNameFor
(
const
QString
&
buildConfiguration
);
void
setDisplayNameFor
(
const
QString
&
buildConfiguration
,
const
QString
&
displayName
);
QString
activeBuildConfiguration
()
const
;
...
...
@@ -191,8 +188,6 @@ protected:
virtual
bool
restoreSettingsImpl
(
PersistentSettingsReader
&
reader
);
private:
BuildConfiguration
*
getBuildConfiguration
(
const
QString
&
name
)
const
;
QList
<
BuildStep
*>
m_buildSteps
;
QList
<
BuildStep
*>
m_cleanSteps
;
QStringList
m_buildConfigurations
;
...
...
src/plugins/projectexplorer/projectexplorer.cpp
View file @
30362e10
...
...
@@ -62,6 +62,7 @@
#include "projectwelcomepage.h"
#include "projectwelcomepagewidget.h"
#include "corelistenercheckingforrunningbuild.h"
#include "buildconfiguration.h"
#include <coreplugin/basemode.h>
#include <coreplugin/coreconstants.h>
...
...
@@ -1916,7 +1917,7 @@ void ProjectExplorerPlugin::populateBuildConfigurationMenu()
if
(
Project
*
pro
=
d
->
m_currentProject
)
{
const
QString
&
activeBuildConfiguration
=
pro
->
activeBuildConfiguration
();
foreach
(
const
QString
&
buildConfiguration
,
pro
->
buildConfigurations
())
{
QString
displayName
=
pro
->
displayNameFor
(
buildConfiguration
);
QString
displayName
=
pro
->
buildConfiguration
(
buildConfiguration
)
->
displayName
()
;
QAction
*
act
=
new
QAction
(
displayName
,
d
->
m_buildConfigurationActionGroup
);
if
(
debug
)
qDebug
()
<<
"BuildConfiguration "
<<
buildConfiguration
<<
"active: "
<<
activeBuildConfiguration
;
...
...
src/plugins/projectexplorer/projectwindow.cpp
View file @
30362e10
...
...
@@ -37,6 +37,7 @@
#include "session.h"
#include "projecttreewidget.h"
#include "runconfiguration.h"
#include "buildconfiguration.h"
#include <coreplugin/minisplitter.h>
#include <coreplugin/fileiconprovider.h>
...
...
@@ -436,7 +437,7 @@ BuildConfigurationComboBox::BuildConfigurationComboBox(Project *p, QWidget *pare
//m_comboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
QStringList
buildConfigurations
=
p
->
buildConfigurations
();
foreach
(
const
QString
&
buildConfiguration
,
buildConfigurations
)
m_comboBox
->
addItem
(
p
->
displayNameFor
(
buildConfiguration
),
buildConfiguration
);
m_comboBox
->
addItem
(
p
->
buildConfiguration
(
buildConfiguration
)
->
displayName
()
,
buildConfiguration
);
if
(
buildConfigurations
.
count
()
==
1
)
{
m_label
->
setText
(
m_comboBox
->
itemText
(
0
));
setCurrentWidget
(
m_label
);
...
...
@@ -468,7 +469,7 @@ void BuildConfigurationComboBox::nameChanged(const QString &buildConfiguration)
int
index
=
nameToIndex
(
buildConfiguration
);
if
(
index
==
-
1
)
return
;
const
QString
&
displayName
=
m_project
->
displayNameFor
(
buildConfiguration
);
const
QString
&
displayName
=
m_project
->
buildConfiguration
(
buildConfiguration
)
->
displayName
()
;
m_comboBox
->
setItemText
(
index
,
displayName
);
if
(
m_comboBox
->
count
()
==
1
)
m_label
->
setText
(
displayName
);
...
...
@@ -495,7 +496,7 @@ void BuildConfigurationComboBox::activeConfigurationChanged()
void
BuildConfigurationComboBox
::
addedBuildConfiguration
(
ProjectExplorer
::
Project
*
,
const
QString
&
buildConfiguration
)
{
ignoreIndexChange
=
true
;
m_comboBox
->
addItem
(
m_project
->
displayNameFor
(
buildConfiguration
),
buildConfiguration
);
m_comboBox
->
addItem
(
m_project
->
buildConfiguration
(
buildConfiguration
)
->
displayName
()
,
buildConfiguration
);
if
(
m_comboBox
->
count
()
==
2
)
setCurrentWidget
(
m_comboBox
);
...
...
src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
View file @
30362e10
...
...
@@ -40,6 +40,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/mainwindow.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/buildconfiguration.h>
#include <extensionsystem/pluginmanager.h>
#include <QtGui/QFileDialog>
...
...
@@ -172,7 +173,7 @@ void Qt4ProjectConfigWidget::init(const QString &buildConfiguration)
m_buildConfiguration
=
buildConfiguration
;
m_ui
->
nameLineEdit
->
setText
(
m_pro
->
displayNameFor
(
m_buildConfiguration
));
m_ui
->
nameLineEdit
->
setText
(
m_pro
->
buildConfiguration
(
m_buildConfiguration
)
->
displayName
()
);
setupQtVersionsComboBox
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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