Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
81479739
Commit
81479739
authored
May 20, 2011
by
Kai Koehne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BuildConfiguration: Adapt name if Qt version changes
Change-Id: I1a34cb51f73af9779d6bdb07324d5dadcb5585b3
parent
28e08047
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
66 additions
and
10 deletions
+66
-10
src/plugins/projectexplorer/projectconfiguration.cpp
src/plugins/projectexplorer/projectconfiguration.cpp
+10
-1
src/plugins/projectexplorer/projectconfiguration.h
src/plugins/projectexplorer/projectconfiguration.h
+2
-0
src/plugins/projectexplorer/target.cpp
src/plugins/projectexplorer/target.cpp
+7
-1
src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp
.../qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp
+1
-1
src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp
...t4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp
+1
-1
src/plugins/qt4projectmanager/qt-maemo/qt4maemotargetfactory.cpp
...gins/qt4projectmanager/qt-maemo/qt4maemotargetfactory.cpp
+1
-1
src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp
...gins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp
+1
-1
src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
+12
-2
src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
+20
-0
src/plugins/qt4projectmanager/qt4target.cpp
src/plugins/qt4projectmanager/qt4target.cpp
+4
-2
src/plugins/qt4projectmanager/qt4target.h
src/plugins/qt4projectmanager/qt4target.h
+7
-0
No files found.
src/plugins/projectexplorer/projectconfiguration.cpp
View file @
81479739
...
@@ -75,7 +75,11 @@ void ProjectConfiguration::setDisplayName(const QString &name)
...
@@ -75,7 +75,11 @@ void ProjectConfiguration::setDisplayName(const QString &name)
{
{
if
(
displayName
()
==
name
)
if
(
displayName
()
==
name
)
return
;
return
;
if
(
name
==
m_defaultDisplayName
)
{
m_displayName
.
clear
();
}
else
{
m_displayName
=
name
;
m_displayName
=
name
;
}
emit
displayNameChanged
();
emit
displayNameChanged
();
}
}
...
@@ -89,6 +93,11 @@ void ProjectConfiguration::setDefaultDisplayName(const QString &name)
...
@@ -89,6 +93,11 @@ void ProjectConfiguration::setDefaultDisplayName(const QString &name)
emit
displayNameChanged
();
emit
displayNameChanged
();
}
}
bool
ProjectConfiguration
::
usesDefaultDisplayName
()
const
{
return
m_displayName
.
isEmpty
();
}
QVariantMap
ProjectConfiguration
::
toMap
()
const
QVariantMap
ProjectConfiguration
::
toMap
()
const
{
{
QVariantMap
map
;
QVariantMap
map
;
...
...
src/plugins/projectexplorer/projectconfiguration.h
View file @
81479739
...
@@ -53,6 +53,8 @@ public:
...
@@ -53,6 +53,8 @@ public:
QString
id
()
const
;
QString
id
()
const
;
QString
displayName
()
const
;
QString
displayName
()
const
;
bool
usesDefaultDisplayName
()
const
;
void
setDisplayName
(
const
QString
&
name
);
void
setDisplayName
(
const
QString
&
name
);
void
setDefaultDisplayName
(
const
QString
&
name
);
void
setDefaultDisplayName
(
const
QString
&
name
);
...
...
src/plugins/projectexplorer/target.cpp
View file @
81479739
...
@@ -144,7 +144,13 @@ void Target::addBuildConfiguration(BuildConfiguration *configuration)
...
@@ -144,7 +144,13 @@ void Target::addBuildConfiguration(BuildConfiguration *configuration)
foreach
(
const
BuildConfiguration
*
bc
,
d
->
m_buildConfigurations
)
foreach
(
const
BuildConfiguration
*
bc
,
d
->
m_buildConfigurations
)
displayNames
<<
bc
->
displayName
();
displayNames
<<
bc
->
displayName
();
configurationDisplayName
=
Project
::
makeUnique
(
configurationDisplayName
,
displayNames
);
configurationDisplayName
=
Project
::
makeUnique
(
configurationDisplayName
,
displayNames
);
if
(
configurationDisplayName
!=
configuration
->
displayName
())
{
if
(
configuration
->
usesDefaultDisplayName
())
{
configuration
->
setDefaultDisplayName
(
configurationDisplayName
);
}
else
{
configuration
->
setDisplayName
(
configurationDisplayName
);
configuration
->
setDisplayName
(
configurationDisplayName
);
}
}
// Make sure we have a sane tool chain if at all possible
// Make sure we have a sane tool chain if at all possible
if
(
!
configuration
->
toolChain
()
if
(
!
configuration
->
toolChain
()
...
...
src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp
View file @
81479739
...
@@ -177,7 +177,7 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::create(ProjectExplorer::Projec
...
@@ -177,7 +177,7 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::create(ProjectExplorer::Projec
Qt4DesktopTarget
*
t
=
new
Qt4DesktopTarget
(
static_cast
<
Qt4Project
*>
(
parent
),
id
);
Qt4DesktopTarget
*
t
=
new
Qt4DesktopTarget
(
static_cast
<
Qt4Project
*>
(
parent
),
id
);
foreach
(
const
BuildConfigurationInfo
&
info
,
infos
)
foreach
(
const
BuildConfigurationInfo
&
info
,
infos
)
t
->
addQt4BuildConfiguration
(
msgBuildConfigurationName
(
info
),
t
->
addQt4BuildConfiguration
(
msgBuildConfigurationName
(
info
),
QString
(),
info
.
version
,
info
.
buildConfig
,
info
.
version
,
info
.
buildConfig
,
info
.
additionalArguments
,
info
.
directory
);
info
.
additionalArguments
,
info
.
directory
);
...
...
src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp
View file @
81479739
...
@@ -162,7 +162,7 @@ ProjectExplorer::Target *Qt4SimulatorTargetFactory::create(ProjectExplorer::Proj
...
@@ -162,7 +162,7 @@ ProjectExplorer::Target *Qt4SimulatorTargetFactory::create(ProjectExplorer::Proj
Qt4SimulatorTarget
*
t
=
new
Qt4SimulatorTarget
(
static_cast
<
Qt4Project
*>
(
parent
),
id
);
Qt4SimulatorTarget
*
t
=
new
Qt4SimulatorTarget
(
static_cast
<
Qt4Project
*>
(
parent
),
id
);
foreach
(
const
BuildConfigurationInfo
&
info
,
infos
)
foreach
(
const
BuildConfigurationInfo
&
info
,
infos
)
t
->
addQt4BuildConfiguration
(
msgBuildConfigurationName
(
info
),
info
.
version
,
info
.
buildConfig
,
t
->
addQt4BuildConfiguration
(
msgBuildConfigurationName
(
info
),
QString
(),
info
.
version
,
info
.
buildConfig
,
info
.
additionalArguments
,
info
.
directory
);
info
.
additionalArguments
,
info
.
directory
);
t
->
addDeployConfiguration
(
t
->
createDeployConfiguration
(
ProjectExplorer
::
Constants
::
DEFAULT_DEPLOYCONFIGURATION_ID
));
t
->
addDeployConfiguration
(
t
->
createDeployConfiguration
(
ProjectExplorer
::
Constants
::
DEFAULT_DEPLOYCONFIGURATION_ID
));
...
...
src/plugins/qt4projectmanager/qt-maemo/qt4maemotargetfactory.cpp
View file @
81479739
...
@@ -212,7 +212,7 @@ ProjectExplorer::Target *Qt4MaemoTargetFactory::create(ProjectExplorer::Project
...
@@ -212,7 +212,7 @@ ProjectExplorer::Target *Qt4MaemoTargetFactory::create(ProjectExplorer::Project
Q_ASSERT
(
target
);
Q_ASSERT
(
target
);
foreach
(
const
BuildConfigurationInfo
&
info
,
infos
)
foreach
(
const
BuildConfigurationInfo
&
info
,
infos
)
target
->
addQt4BuildConfiguration
(
msgBuildConfigurationName
(
info
),
target
->
addQt4BuildConfiguration
(
msgBuildConfigurationName
(
info
),
QString
(),
info
.
version
,
info
.
buildConfig
,
info
.
version
,
info
.
buildConfig
,
info
.
additionalArguments
,
info
.
directory
);
info
.
additionalArguments
,
info
.
directory
);
...
...
src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp
View file @
81479739
...
@@ -219,7 +219,7 @@ ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Projec
...
@@ -219,7 +219,7 @@ ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Projec
return
0
;
return
0
;
Qt4SymbianTarget
*
t
=
new
Qt4SymbianTarget
(
static_cast
<
Qt4Project
*>
(
parent
),
id
);
Qt4SymbianTarget
*
t
=
new
Qt4SymbianTarget
(
static_cast
<
Qt4Project
*>
(
parent
),
id
);
foreach
(
const
BuildConfigurationInfo
&
info
,
infos
)
foreach
(
const
BuildConfigurationInfo
&
info
,
infos
)
t
->
addQt4BuildConfiguration
(
msgBuildConfigurationName
(
info
),
t
->
addQt4BuildConfiguration
(
msgBuildConfigurationName
(
info
),
QString
(),
info
.
version
,
info
.
buildConfig
,
info
.
version
,
info
.
buildConfig
,
info
.
additionalArguments
,
info
.
directory
);
info
.
additionalArguments
,
info
.
directory
);
...
...
src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
View file @
81479739
...
@@ -734,14 +734,24 @@ BuildConfiguration *Qt4BuildConfigurationFactory::create(ProjectExplorer::Target
...
@@ -734,14 +734,24 @@ BuildConfiguration *Qt4BuildConfigurationFactory::create(ProjectExplorer::Target
return
0
;
return
0
;
//: Debug build configuration. We recommend not translating it.
//: Debug build configuration. We recommend not translating it.
BuildConfiguration
*
bc
=
qt4Target
->
addQt4BuildConfiguration
(
tr
(
"%1 Debug"
).
arg
(
buildConfigurationName
),
QString
defaultDebugName
=
tr
(
"%1 Debug"
).
arg
(
version
->
displayName
());
QString
customDebugName
;
if
(
buildConfigurationName
!=
version
->
displayName
())
customDebugName
=
tr
(
"%1 Debug"
).
arg
(
buildConfigurationName
);
BuildConfiguration
*
bc
=
qt4Target
->
addQt4BuildConfiguration
(
defaultDebugName
,
customDebugName
,
version
,
version
,
(
version
->
defaultBuildConfig
()
|
QtSupport
::
BaseQtVersion
::
DebugBuild
),
(
version
->
defaultBuildConfig
()
|
QtSupport
::
BaseQtVersion
::
DebugBuild
),
QString
(),
QString
());
QString
(),
QString
());
if
(
qt4Target
->
id
()
!=
Constants
::
S60_EMULATOR_TARGET_ID
)
{
if
(
qt4Target
->
id
()
!=
Constants
::
S60_EMULATOR_TARGET_ID
)
{
//: Release build configuration. We recommend not translating it.
//: Release build configuration. We recommend not translating it.
bc
=
qt4Target
->
addQt4BuildConfiguration
(
tr
(
"%1 Release"
).
arg
(
buildConfigurationName
),
QString
defaultReleaseName
=
tr
(
"%1 Release"
).
arg
(
version
->
displayName
());
QString
customReleaseName
;
if
(
buildConfigurationName
!=
version
->
displayName
())
customReleaseName
=
tr
(
"%1 Release"
).
arg
(
buildConfigurationName
);
bc
=
qt4Target
->
addQt4BuildConfiguration
(
defaultReleaseName
,
customReleaseName
,
version
,
version
,
(
version
->
defaultBuildConfig
()
&
~
QtSupport
::
BaseQtVersion
::
DebugBuild
),
(
version
->
defaultBuildConfig
()
&
~
QtSupport
::
BaseQtVersion
::
DebugBuild
),
QString
(),
QString
());
QString
(),
QString
());
...
...
src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
View file @
81479739
...
@@ -473,9 +473,29 @@ void Qt4ProjectConfigWidget::qtVersionSelected(const QString &)
...
@@ -473,9 +473,29 @@ void Qt4ProjectConfigWidget::qtVersionSelected(const QString &)
QtSupport
::
QtVersionManager
*
vm
=
QtSupport
::
QtVersionManager
::
instance
();
QtSupport
::
QtVersionManager
*
vm
=
QtSupport
::
QtVersionManager
::
instance
();
QtSupport
::
BaseQtVersion
*
newQtVersion
=
vm
->
version
(
newQtVersionId
);
QtSupport
::
BaseQtVersion
*
newQtVersion
=
vm
->
version
(
newQtVersionId
);
if
(
newQtVersion
)
{
const
QString
qtVersionName
=
newQtVersion
->
displayName
();
QString
defaultConfigName
=
(
m_buildConfiguration
->
buildType
()
&
BuildConfiguration
::
Debug
)
?
//: Name of a debug build configuration to created by a project wizard, %1 being the Qt version name. We recommend not translating it.
tr
(
"%1 Debug"
).
arg
(
qtVersionName
)
:
//: Name of a release build configuration to created by a project wizard, %1 being the Qt version name. We recommend not translating it.
tr
(
"%1 Release"
).
arg
(
qtVersionName
);
// make name unique
QStringList
displayNames
;
foreach
(
const
BuildConfiguration
*
bc
,
m_buildConfiguration
->
target
()
->
buildConfigurations
())
{
if
(
bc
!=
m_buildConfiguration
)
displayNames
<<
bc
->
displayName
();
}
defaultConfigName
=
Project
::
makeUnique
(
defaultConfigName
,
displayNames
);
m_buildConfiguration
->
setDefaultDisplayName
(
defaultConfigName
);
}
m_ignoreChange
=
true
;
m_ignoreChange
=
true
;
m_buildConfiguration
->
setQtVersion
(
newQtVersion
);
m_buildConfiguration
->
setQtVersion
(
newQtVersion
);
m_ignoreChange
=
false
;
m_ignoreChange
=
false
;
m_ui
->
qtVersionComboBox
->
setToolTip
(
newQtVersion
?
newQtVersion
->
toHtml
(
false
)
:
QString
());
m_ui
->
qtVersionComboBox
->
setToolTip
(
newQtVersion
?
newQtVersion
->
toHtml
(
false
)
:
QString
());
updateShadowBuildUi
();
updateShadowBuildUi
();
...
...
src/plugins/qt4projectmanager/qt4target.cpp
View file @
81479739
...
@@ -277,7 +277,8 @@ void Qt4BaseTarget::removeUnconfiguredCustomExectutableRunConfigurations()
...
@@ -277,7 +277,8 @@ void Qt4BaseTarget::removeUnconfiguredCustomExectutableRunConfigurations()
}
}
}
}
Qt4BuildConfiguration
*
Qt4BaseTarget
::
addQt4BuildConfiguration
(
QString
displayName
,
QtSupport
::
BaseQtVersion
*
qtversion
,
Qt4BuildConfiguration
*
Qt4BaseTarget
::
addQt4BuildConfiguration
(
QString
defaultDisplayName
,
QString
displayName
,
QtSupport
::
BaseQtVersion
*
qtversion
,
QtSupport
::
BaseQtVersion
::
QmakeBuildConfigs
qmakeBuildConfiguration
,
QtSupport
::
BaseQtVersion
::
QmakeBuildConfigs
qmakeBuildConfiguration
,
QString
additionalArguments
,
QString
additionalArguments
,
QString
directory
)
QString
directory
)
...
@@ -287,7 +288,8 @@ Qt4BuildConfiguration *Qt4BaseTarget::addQt4BuildConfiguration(QString displayNa
...
@@ -287,7 +288,8 @@ Qt4BuildConfiguration *Qt4BaseTarget::addQt4BuildConfiguration(QString displayNa
// Add the buildconfiguration
// Add the buildconfiguration
Qt4BuildConfiguration
*
bc
=
new
Qt4BuildConfiguration
(
this
);
Qt4BuildConfiguration
*
bc
=
new
Qt4BuildConfiguration
(
this
);
bc
->
setDefaultDisplayName
(
displayName
);
bc
->
setDefaultDisplayName
(
defaultDisplayName
);
bc
->
setDisplayName
(
displayName
);
ProjectExplorer
::
BuildStepList
*
buildSteps
=
bc
->
stepList
(
ProjectExplorer
::
Constants
::
BUILDSTEPS_BUILD
);
ProjectExplorer
::
BuildStepList
*
buildSteps
=
bc
->
stepList
(
ProjectExplorer
::
Constants
::
BUILDSTEPS_BUILD
);
ProjectExplorer
::
BuildStepList
*
cleanSteps
=
bc
->
stepList
(
ProjectExplorer
::
Constants
::
BUILDSTEPS_CLEAN
);
ProjectExplorer
::
BuildStepList
*
cleanSteps
=
bc
->
stepList
(
ProjectExplorer
::
Constants
::
BUILDSTEPS_CLEAN
);
...
...
src/plugins/qt4projectmanager/qt4target.h
View file @
81479739
...
@@ -77,9 +77,16 @@ public:
...
@@ -77,9 +77,16 @@ public:
// This is the same for almost all Qt4Targets
// This is the same for almost all Qt4Targets
// so for now offer a convience function
// so for now offer a convience function
<<<<<<<
HEAD
Qt4BuildConfiguration
*
addQt4BuildConfiguration
(
QString
displayName
,
Qt4BuildConfiguration
*
addQt4BuildConfiguration
(
QString
displayName
,
QtSupport
::
BaseQtVersion
*
qtversion
,
QtSupport
::
BaseQtVersion
*
qtversion
,
QtSupport
::
BaseQtVersion
::
QmakeBuildConfigs
qmakeBuildConfiguration
,
QtSupport
::
BaseQtVersion
::
QmakeBuildConfigs
qmakeBuildConfiguration
,
=======
Qt4BuildConfiguration
*
addQt4BuildConfiguration
(
QString
defaultDisplayName
,
QString
displayName
,
BaseQtVersion
*
qtversion
,
BaseQtVersion
::
QmakeBuildConfigs
qmakeBuildConfiguration
,
>>>>>>>
BuildConfiguration
:
Adapt
name
if
Qt
version
changes
QString
additionalArguments
,
QString
additionalArguments
,
QString
directory
);
QString
directory
);
...
...
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