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
Tobias Hunger
qt-creator
Commits
0a2a28ec
Commit
0a2a28ec
authored
Oct 04, 2010
by
Tobias Hunger
Browse files
Do not allow all WS names in Run-/Deploy-/BuildCOnfigs
Task-number: QTCREATORBUG-2584
parent
1261e9e1
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/buildsettingspropertiespage.cpp
View file @
0a2a28ec
...
...
@@ -328,6 +328,21 @@ void BuildSettingsWidget::deleteConfiguration()
deleteConfiguration
(
m_buildConfiguration
);
}
QString
BuildSettingsWidget
::
uniqueName
(
const
QString
&
name
)
{
QString
result
=
name
.
trimmed
();
if
(
!
result
.
isEmpty
())
{
QStringList
bcNames
;
foreach
(
BuildConfiguration
*
bc
,
m_target
->
buildConfigurations
())
{
if
(
bc
==
m_buildConfiguration
)
continue
;
bcNames
.
append
(
bc
->
displayName
());
}
result
=
Project
::
makeUnique
(
result
,
bcNames
);
}
return
result
;
}
void
BuildSettingsWidget
::
renameConfiguration
()
{
bool
ok
;
...
...
@@ -339,15 +354,10 @@ void BuildSettingsWidget::renameConfiguration()
if
(
!
ok
||
!
this
)
return
;
if
(
!
name
.
isEmpty
())
{
QStringList
bcNames
;
foreach
(
BuildConfiguration
*
bc
,
m_target
->
buildConfigurations
())
{
if
(
bc
==
m_buildConfiguration
)
continue
;
bcNames
.
append
(
bc
->
displayName
());
}
name
=
Project
::
makeUnique
(
name
,
bcNames
);
}
name
=
uniqueName
(
name
);
if
(
name
.
isEmpty
())
return
;
m_buildConfiguration
->
setDisplayName
(
name
);
}
...
...
@@ -359,15 +369,15 @@ void BuildSettingsWidget::cloneConfiguration(BuildConfiguration *sourceConfigura
return
;
//: Title of a the cloned BuildConfiguration window, text of the window
QString
n
ewDisplay
Name
(
QInputDialog
::
getText
(
this
,
tr
(
"Clone Configuration"
),
tr
(
"New configuration name:"
)));
if
(
n
ewDisplayN
ame
.
isEmpty
())
QString
n
ame
=
unique
Name
(
QInputDialog
::
getText
(
this
,
tr
(
"Clone Configuration"
),
tr
(
"New configuration name:"
)));
if
(
name
.
isEmpty
())
return
;
BuildConfiguration
*
bc
(
m_target
->
buildConfigurationFactory
()
->
clone
(
m_target
,
sourceConfiguration
));
if
(
!
bc
)
return
;
bc
->
setDisplayName
(
n
ewDisplayN
ame
);
bc
->
setDisplayName
(
name
);
m_target
->
addBuildConfiguration
(
bc
);
updateBuildSettings
();
...
...
src/plugins/projectexplorer/buildsettingspropertiespage.h
View file @
0a2a28ec
...
...
@@ -107,6 +107,7 @@ private slots:
private:
void
cloneConfiguration
(
BuildConfiguration
*
toClone
);
void
deleteConfiguration
(
BuildConfiguration
*
toDelete
);
QString
uniqueName
(
const
QString
&
name
);
Target
*
m_target
;
BuildConfiguration
*
m_buildConfiguration
;
...
...
src/plugins/projectexplorer/runsettingspropertiespage.cpp
View file @
0a2a28ec
...
...
@@ -293,15 +293,10 @@ void RunSettingsWidget::renameRunConfiguration()
if
(
!
ok
||
!
this
)
return
;
if
(
!
name
.
isEmpty
())
{
QStringList
rcNames
;
foreach
(
RunConfiguration
*
rc
,
m_target
->
runConfigurations
())
{
if
(
rc
==
m_target
->
activeRunConfiguration
())
continue
;
rcNames
.
append
(
rc
->
displayName
());
}
name
=
Project
::
makeUnique
(
name
,
rcNames
);
}
name
=
uniqueRCName
(
name
);
if
(
name
.
isEmpty
())
return
;
m_target
->
activeRunConfiguration
()
->
setDisplayName
(
name
);
}
...
...
@@ -393,15 +388,9 @@ void RunSettingsWidget::renameDeployConfiguration()
if
(
!
ok
||
!
this
)
return
;
if
(
!
name
.
isEmpty
())
{
QStringList
dcNames
;
foreach
(
DeployConfiguration
*
dc
,
m_target
->
deployConfigurations
())
{
if
(
dc
==
m_target
->
activeDeployConfiguration
())
continue
;
dcNames
.
append
(
dc
->
displayName
());
}
name
=
Project
::
makeUnique
(
name
,
dcNames
);
}
name
=
uniqueDCName
(
name
);
if
(
name
.
isEmpty
())
return
;
m_target
->
activeDeployConfiguration
()
->
setDisplayName
(
name
);
}
...
...
@@ -430,3 +419,33 @@ void RunSettingsWidget::updateDeployConfiguration(DeployConfiguration *dc)
m_deploySteps
->
init
(
dc
->
stepList
());
m_deployLayout
->
addWidget
(
m_deploySteps
);
}
QString
RunSettingsWidget
::
uniqueDCName
(
const
QString
&
name
)
{
QString
result
=
name
.
trimmed
();
if
(
!
result
.
isEmpty
())
{
QStringList
dcNames
;
foreach
(
DeployConfiguration
*
dc
,
m_target
->
deployConfigurations
())
{
if
(
dc
==
m_target
->
activeDeployConfiguration
())
continue
;
dcNames
.
append
(
dc
->
displayName
());
}
result
=
Project
::
makeUnique
(
result
,
dcNames
);
}
return
result
;
}
QString
RunSettingsWidget
::
uniqueRCName
(
const
QString
&
name
)
{
QString
result
=
name
.
trimmed
();
if
(
!
result
.
isEmpty
())
{
QStringList
rcNames
;
foreach
(
RunConfiguration
*
rc
,
m_target
->
runConfigurations
())
{
if
(
rc
==
m_target
->
activeRunConfiguration
())
continue
;
rcNames
.
append
(
rc
->
displayName
());
}
result
=
Project
::
makeUnique
(
result
,
rcNames
);
}
return
result
;
}
src/plugins/projectexplorer/runsettingspropertiespage.h
View file @
0a2a28ec
...
...
@@ -104,7 +104,10 @@ private slots:
void
renameDeployConfiguration
();
private:
QString
uniqueDCName
(
const
QString
&
name
);
QString
uniqueRCName
(
const
QString
&
name
);
void
updateDeployConfiguration
(
DeployConfiguration
*
);
Target
*
m_target
;
RunConfigurationModel
*
m_runConfigurationsModel
;
DeployConfigurationModel
*
m_deployConfigurationModel
;
...
...
src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
View file @
0a2a28ec
...
...
@@ -710,6 +710,7 @@ BuildConfiguration *Qt4BuildConfigurationFactory::create(ProjectExplorer::Target
QLineEdit
::
Normal
,
version
->
displayName
(),
&
ok
);
buildConfigurationName
=
buildConfigurationName
.
trimmed
();
if
(
!
ok
||
buildConfigurationName
.
isEmpty
())
return
0
;
...
...
Write
Preview
Markdown
is supported
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