Commit 7bd3bba6 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

L10n: Tr-fixes for build configurations.

Remove duplicate code, proper messages, linguist comments.

Task-number: QTCREATORBUG-3821
parent fe5a7ed2
......@@ -161,15 +161,10 @@ Qt4BaseTarget *Qt4DesktopTargetFactory::create(ProjectExplorer::Project *parent,
return 0;
Qt4DesktopTarget *t = new Qt4DesktopTarget(static_cast<Qt4Project *>(parent), id);
foreach (const BuildConfigurationInfo &info, infos) {
QString displayName = info.version->displayName() + QLatin1Char(' ');
displayName += (info.buildConfig & QtVersion::DebugBuild) ? tr("Debug") : tr("Release");
t->addQt4BuildConfiguration(displayName,
info.version,
info.buildConfig,
info.additionalArguments,
info.directory);
}
foreach (const BuildConfigurationInfo &info, infos)
t->addQt4BuildConfiguration(msgBuildConfigurationName(info),
info.version, info.buildConfig,
info.additionalArguments, info.directory);
t->addDeployConfiguration(t->deployConfigurationFactory()->create(t, ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID));
......
......@@ -161,15 +161,9 @@ Qt4BaseTarget *Qt4SimulatorTargetFactory::create(ProjectExplorer::Project *paren
return 0;
Qt4SimulatorTarget *t = new Qt4SimulatorTarget(static_cast<Qt4Project *>(parent), id);
foreach (const BuildConfigurationInfo &info, infos) {
QString displayName = info.version->displayName() + QLatin1Char(' ');
displayName += (info.buildConfig & QtVersion::DebugBuild) ? tr("Debug") : tr("Release");
t->addQt4BuildConfiguration(displayName,
info.version,
info.buildConfig,
info.additionalArguments,
info.directory);
}
foreach (const BuildConfigurationInfo &info, infos)
t->addQt4BuildConfiguration(msgBuildConfigurationName(info), info.version, info.buildConfig,
info.additionalArguments, info.directory);
t->addDeployConfiguration(t->deployConfigurationFactory()->create(t, ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID));
......
......@@ -204,15 +204,10 @@ Qt4BaseTarget *Qt4MaemoTargetFactory::create(ProjectExplorer::Project *parent,
target = new Qt4MeegoTarget(static_cast<Qt4Project *>(parent), id);
Q_ASSERT(target);
foreach (const BuildConfigurationInfo &info, infos) {
QString displayName = info.version->displayName() + QLatin1Char(' ');
displayName += (info.buildConfig & QtVersion::DebugBuild) ? tr("Debug") : tr("Release");
target->addQt4BuildConfiguration(displayName,
info.version,
info.buildConfig,
info.additionalArguments,
info.directory);
}
foreach (const BuildConfigurationInfo &info, infos)
target->addQt4BuildConfiguration(msgBuildConfigurationName(info),
info.version, info.buildConfig,
info.additionalArguments, info.directory);
target->addDeployConfiguration(target->deployConfigurationFactory()->create(target, ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID));
target->createApplicationProFiles();
......
......@@ -188,15 +188,10 @@ Qt4BaseTarget *Qt4SymbianTargetFactory::create(ProjectExplorer::Project *parent,
if (!canCreate(parent, id))
return 0;
Qt4SymbianTarget *t = new Qt4SymbianTarget(static_cast<Qt4Project *>(parent), id);
foreach (const BuildConfigurationInfo &info, infos) {
QString displayName = info.version->displayName() + QLatin1Char(' ');
displayName += (info.buildConfig & QtVersion::DebugBuild) ? tr("Debug") : tr("Release");
t->addQt4BuildConfiguration(displayName,
info.version,
info.buildConfig,
info.additionalArguments,
info.directory);
}
foreach (const BuildConfigurationInfo &info, infos)
t->addQt4BuildConfiguration(msgBuildConfigurationName(info),
info.version, info.buildConfig,
info.additionalArguments, info.directory);
t->addDeployConfiguration(t->deployConfigurationFactory()->create(t, ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID));
......
......@@ -759,11 +759,13 @@ BuildConfiguration *Qt4BuildConfigurationFactory::create(ProjectExplorer::Target
if (!ok || buildConfigurationName.isEmpty())
return 0;
//: Debug build configuration. We recommend not translating it.
qt4Target->addQt4BuildConfiguration(tr("%1 Debug").arg(buildConfigurationName),
version,
(version->defaultBuildConfig() | QtVersion::DebugBuild),
QString(), QString());
BuildConfiguration *bc =
//: Release build configuration. We recommend not translating it.
qt4Target->addQt4BuildConfiguration(tr("%1 Release").arg(buildConfigurationName),
version,
(version->defaultBuildConfig() & ~QtVersion::DebugBuild),
......
......@@ -73,6 +73,17 @@ Qt4BaseTargetFactory *Qt4BaseTargetFactory::qt4BaseTargetFactoryForId(const QStr
return 0;
}
// Return name of a build configuration.
QString Qt4BaseTargetFactory::msgBuildConfigurationName(const BuildConfigurationInfo &info)
{
const QString qtVersionName = info.version->displayName();
return (info.buildConfig & QtVersion::DebugBuild) ?
//: 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);
}
// -------------------------------------------------------------------------
// Qt4BaseTarget
// -------------------------------------------------------------------------
......
......@@ -116,6 +116,9 @@ public:
QList<BuildConfigurationInfo> infos) = 0;
static Qt4BaseTargetFactory *qt4BaseTargetFactoryForId(const QString &id);
protected:
static QString msgBuildConfigurationName(const BuildConfigurationInfo &info);
};
} // namespace Qt4ProjectManager
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment