forked from qt-creator/qt-creator
Enable restoring the default names of project configuration items
* Enable support for this in all ProjectConfiguration items (Targets, projects, BCs, DCs, RCs, etc.). This is nicer than having custom code in individual configuraiton items. Reviewed-by: dt
This commit is contained in:
@@ -108,7 +108,7 @@ CMakeRunConfiguration::~CMakeRunConfiguration()
|
||||
|
||||
void CMakeRunConfiguration::ctor()
|
||||
{
|
||||
setDisplayName(m_title);
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
}
|
||||
|
||||
CMakeTarget *CMakeRunConfiguration::cmakeTarget() const
|
||||
@@ -205,6 +205,13 @@ bool CMakeRunConfiguration::fromMap(const QVariantMap &map)
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
QString CMakeRunConfiguration::defaultDisplayName() const
|
||||
{
|
||||
if (m_title.isEmpty())
|
||||
return tr("Run CMake target");
|
||||
return m_title + (m_enabled ? "" : tr(" (disabled)"));
|
||||
}
|
||||
|
||||
QWidget *CMakeRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
return new CMakeRunConfigurationWidget(this);
|
||||
@@ -302,7 +309,7 @@ void CMakeRunConfiguration::setEnabled(bool b)
|
||||
return;
|
||||
m_enabled = b;
|
||||
emit isEnabledChanged(isEnabled());
|
||||
setDisplayName(m_title + (m_enabled ? "" : tr(" (disabled)")));
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
}
|
||||
|
||||
bool CMakeRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *bc) const
|
||||
|
||||
@@ -97,6 +97,7 @@ private slots:
|
||||
protected:
|
||||
CMakeRunConfiguration(CMakeTarget *parent, CMakeRunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
QString defaultDisplayName() const;
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
|
||||
@@ -64,7 +64,7 @@ CMakeTarget::CMakeTarget(CMakeProject *parent) :
|
||||
m_buildConfigurationFactory(new CMakeBuildConfigurationFactory(this)),
|
||||
m_deployConfigurationFactory(new ProjectExplorer::DeployConfigurationFactory(this))
|
||||
{
|
||||
setDisplayName(displayNameForId(id()));
|
||||
setDefaultDisplayName(displayNameForId(id()));
|
||||
setIcon(qApp->style()->standardIcon(QStyle::SP_ComputerIcon));
|
||||
connect(parent, SIGNAL(buildTargetsChanged()), SLOT(updateRunConfigurations()));
|
||||
}
|
||||
@@ -100,11 +100,7 @@ QString CMakeTarget::defaultBuildDirectory() const
|
||||
|
||||
bool CMakeTarget::fromMap(const QVariantMap &map)
|
||||
{
|
||||
if (!Target::fromMap(map))
|
||||
return false;
|
||||
|
||||
setDisplayName(displayNameForId(id()));
|
||||
return true;
|
||||
return Target::fromMap(map);
|
||||
}
|
||||
|
||||
void CMakeTarget::updateRunConfigurations()
|
||||
@@ -194,7 +190,7 @@ CMakeTarget *CMakeTargetFactory::create(ProjectExplorer::Project *parent, const
|
||||
|
||||
// Add default build configuration:
|
||||
CMakeBuildConfiguration *bc(new CMakeBuildConfiguration(t));
|
||||
bc->setDisplayName("all");
|
||||
bc->setDefaultDisplayName("all");
|
||||
|
||||
ProjectExplorer::BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
ProjectExplorer::BuildStepList *cleanSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
|
||||
|
||||
@@ -85,7 +85,8 @@ MakeStep::MakeStep(BuildStepList *bsl, MakeStep *bs) :
|
||||
void MakeStep::ctor()
|
||||
{
|
||||
m_percentProgress = QRegExp("^\\[\\s*(\\d*)%\\]");
|
||||
setDisplayName(tr("Make", "CMakeProjectManager::MakeStep display name."));
|
||||
//: Default display name for the cmake make step.
|
||||
setDefaultDisplayName(tr("Make"));
|
||||
}
|
||||
|
||||
MakeStep::~MakeStep()
|
||||
|
||||
@@ -52,7 +52,6 @@ const char * const BUILD_DIRECTORY_KEY("GenericProjectManager.GenericBuildConfig
|
||||
GenericBuildConfiguration::GenericBuildConfiguration(GenericTarget *parent)
|
||||
: BuildConfiguration(parent, QLatin1String(GENERIC_BC_ID))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
GenericBuildConfiguration::GenericBuildConfiguration(GenericTarget *parent, const QString &id)
|
||||
|
||||
@@ -84,8 +84,8 @@ GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildStepList *parent, Generic
|
||||
|
||||
void GenericMakeStep::ctor()
|
||||
{
|
||||
setDisplayName(QCoreApplication::translate("GenericProjectManager::Internal::GenericMakeStep",
|
||||
GENERIC_MS_DISPLAY_NAME));
|
||||
setDefaultDisplayName(QCoreApplication::translate("GenericProjectManager::Internal::GenericMakeStep",
|
||||
GENERIC_MS_DISPLAY_NAME));
|
||||
}
|
||||
|
||||
GenericMakeStep::~GenericMakeStep()
|
||||
|
||||
@@ -57,9 +57,8 @@ GenericTarget::GenericTarget(GenericProject *parent) :
|
||||
m_buildConfigurationFactory(new GenericBuildConfigurationFactory(this)),
|
||||
m_deployConfigurationFactory(new ProjectExplorer::DeployConfigurationFactory(this))
|
||||
{
|
||||
setDisplayName(QApplication::translate("GenericProjectManager::GenericTarget",
|
||||
GENERIC_DESKTOP_TARGET_DISPLAY_NAME,
|
||||
"Generic desktop target display name"));
|
||||
setDefaultDisplayName(QApplication::translate("GenericProjectManager::GenericTarget",
|
||||
GENERIC_DESKTOP_TARGET_DISPLAY_NAME));
|
||||
setIcon(qApp->style()->standardIcon(QStyle::SP_ComputerIcon));
|
||||
}
|
||||
|
||||
@@ -92,9 +91,6 @@ bool GenericTarget::fromMap(const QVariantMap &map)
|
||||
if (!Target::fromMap(map))
|
||||
return false;
|
||||
|
||||
setDisplayName(QApplication::translate("GenericProjectManager::GenericTarget",
|
||||
GENERIC_DESKTOP_TARGET_DISPLAY_NAME,
|
||||
"Generic desktop target display name"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,11 +55,11 @@ BuildConfiguration::BuildConfiguration(Target *target, const QString &id) :
|
||||
Q_ASSERT(target);
|
||||
BuildStepList *bsl = new BuildStepList(this, QLatin1String(Constants::BUILDSTEPS_BUILD));
|
||||
//: Display name of the build build step list. Used as part of the labels in the project window.
|
||||
bsl->setDisplayName(tr("Build"));
|
||||
bsl->setDefaultDisplayName(tr("Build"));
|
||||
m_stepLists.append(bsl);
|
||||
bsl = new BuildStepList(this, QLatin1String(Constants::BUILDSTEPS_CLEAN));
|
||||
//: Display name of the clean build step list. Used as part of the labels in the project window.
|
||||
bsl->setDisplayName(tr("Clean"));
|
||||
bsl->setDefaultDisplayName(tr("Clean"));
|
||||
m_stepLists.append(bsl);
|
||||
}
|
||||
|
||||
@@ -108,9 +108,6 @@ QVariantMap BuildConfiguration::toMap() const
|
||||
|
||||
bool BuildConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
if (!ProjectConfiguration::fromMap(map))
|
||||
return false;
|
||||
|
||||
m_clearSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)).toBool();
|
||||
m_userEnvironmentChanges = EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
|
||||
|
||||
@@ -133,11 +130,11 @@ bool BuildConfiguration::fromMap(const QVariantMap &map)
|
||||
m_stepLists.append(list);
|
||||
}
|
||||
|
||||
// TODO: We currently assume there to be at least a clean, build and deploy list!
|
||||
// TODO: We currently assume there to be at least a clean and build list!
|
||||
Q_ASSERT(knownStepLists().contains(QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_BUILD)));
|
||||
Q_ASSERT(knownStepLists().contains(QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)));
|
||||
|
||||
return true;
|
||||
return ProjectConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
Target *BuildConfiguration::target() const
|
||||
|
||||
@@ -327,16 +327,18 @@ void BuildSettingsWidget::renameConfiguration()
|
||||
arg(m_buildConfiguration->displayName()),
|
||||
QLineEdit::Normal,
|
||||
m_buildConfiguration->displayName(), &ok);
|
||||
if (!ok || !this || name.isEmpty())
|
||||
if (!ok || !this)
|
||||
return;
|
||||
|
||||
QStringList bcNames;
|
||||
foreach (BuildConfiguration *bc, m_target->buildConfigurations()) {
|
||||
if (bc == m_buildConfiguration)
|
||||
continue;
|
||||
bcNames.append(bc->displayName());
|
||||
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 = Project::makeUnique(name, bcNames);
|
||||
m_buildConfiguration->setDisplayName(name);
|
||||
|
||||
}
|
||||
@@ -347,15 +349,11 @@ void BuildSettingsWidget::cloneConfiguration(BuildConfiguration *sourceConfigura
|
||||
!m_target->buildConfigurationFactory())
|
||||
return;
|
||||
|
||||
//: Title of a the cloned BuildConfiguration window, text of the window
|
||||
QString newDisplayName(QInputDialog::getText(this, tr("Clone configuration"), tr("New Configuration Name:")));
|
||||
if (newDisplayName.isEmpty())
|
||||
return;
|
||||
|
||||
QStringList buildConfigurationDisplayNames;
|
||||
foreach(BuildConfiguration *bc, m_target->buildConfigurations())
|
||||
buildConfigurationDisplayNames << bc->displayName();
|
||||
newDisplayName = Project::makeUnique(newDisplayName, buildConfigurationDisplayNames);
|
||||
|
||||
BuildConfiguration * bc(m_target->buildConfigurationFactory()->clone(m_target, sourceConfiguration));
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
@@ -83,7 +83,7 @@ BuildStepList::BuildStepList(QObject *parent, BuildStepList *source) :
|
||||
}
|
||||
|
||||
BuildStepList::BuildStepList(QObject *parent, const QVariantMap &data) :
|
||||
ProjectConfiguration(parent, QLatin1String("UNKNOWN"))
|
||||
ProjectConfiguration(parent, QLatin1String("UNKNOWN ID"))
|
||||
{
|
||||
Q_ASSERT(parent);
|
||||
m_isNull = !fromMap(data);
|
||||
@@ -144,9 +144,6 @@ void BuildStepList::cloneSteps(BuildStepList *source)
|
||||
|
||||
bool BuildStepList::fromMap(const QVariantMap &map)
|
||||
{
|
||||
if (!ProjectConfiguration::fromMap(map))
|
||||
return false;
|
||||
|
||||
int maxSteps = map.value(QString::fromLatin1(STEPS_COUNT_KEY), 0).toInt();
|
||||
for (int i = 0; i < maxSteps; ++i) {
|
||||
QVariantMap bsData(map.value(QString::fromLatin1(STEPS_PREFIX) + QString::number(i)).toMap());
|
||||
@@ -166,7 +163,6 @@ bool BuildStepList::fromMap(const QVariantMap &map)
|
||||
}
|
||||
insertStep(m_steps.count(), bs);
|
||||
}
|
||||
|
||||
return ProjectConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
@@ -216,6 +212,5 @@ Target *BuildStepList::target() const
|
||||
DeployConfiguration *dc = qobject_cast<DeployConfiguration *>(parent());
|
||||
if (dc)
|
||||
return dc->target();
|
||||
Q_ASSERT(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,8 @@ void CustomExecutableConfigurationWidget::changed()
|
||||
|
||||
void CustomExecutableRunConfiguration::ctor()
|
||||
{
|
||||
setDisplayName(tr("Run %1").arg(m_executable));
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
|
||||
connect(target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(activeBuildConfigurationChanged()));
|
||||
|
||||
@@ -435,6 +436,14 @@ void CustomExecutableRunConfiguration::setUserEnvironmentChanges(const QList<Pro
|
||||
}
|
||||
}
|
||||
|
||||
QString CustomExecutableRunConfiguration::defaultDisplayName() const
|
||||
{
|
||||
if (m_executable.isEmpty())
|
||||
return tr("Custom Executable");
|
||||
else
|
||||
return tr("Run %1").arg(QDir::toNativeSeparators(m_executable));
|
||||
}
|
||||
|
||||
QVariantMap CustomExecutableRunConfiguration::toMap() const
|
||||
{
|
||||
QVariantMap map(LocalApplicationRunConfiguration::toMap());
|
||||
@@ -456,15 +465,16 @@ bool CustomExecutableRunConfiguration::fromMap(const QVariantMap &map)
|
||||
m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
|
||||
m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(CustomExecutableRunConfiguration::BuildEnvironmentBase)).toInt());
|
||||
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
void CustomExecutableRunConfiguration::setExecutable(const QString &executable)
|
||||
{
|
||||
bool hasUserName = (displayName() != tr("Run %1").arg(m_executable));
|
||||
if (executable == m_executable)
|
||||
return;
|
||||
m_executable = executable;
|
||||
if (!hasUserName)
|
||||
setDisplayName(tr("Run %1").arg(m_executable));
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,11 +87,6 @@ public:
|
||||
*/
|
||||
QString baseExecutable() const;
|
||||
|
||||
/**
|
||||
* Returns the name the user has set, if he has set one
|
||||
*/
|
||||
QString userName() const;
|
||||
|
||||
LocalApplicationRunConfiguration::RunMode runMode() const;
|
||||
QString workingDirectory() const;
|
||||
QString baseWorkingDirectory() const;
|
||||
@@ -118,6 +113,7 @@ private slots:
|
||||
protected:
|
||||
CustomExecutableRunConfiguration(Target *parent, CustomExecutableRunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
QString defaultDisplayName() const;
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
|
||||
@@ -52,8 +52,9 @@ DeployConfiguration::DeployConfiguration(Target *target, const QString &id) :
|
||||
Q_ASSERT(target);
|
||||
m_stepList = new BuildStepList(this, QLatin1String(Constants::BUILDSTEPS_DEPLOY));
|
||||
//: Display name of the deploy build step list. Used as part of the labels in the project window.
|
||||
m_stepList->setDisplayName(tr("Deploy"));
|
||||
setDisplayName(tr("No deployment"));
|
||||
m_stepList->setDefaultDisplayName(tr("Deploy"));
|
||||
//: Default DeployConfiguration display name
|
||||
setDefaultDisplayName(tr("No deployment"));
|
||||
}
|
||||
|
||||
DeployConfiguration::DeployConfiguration(Target *target, DeployConfiguration *source) :
|
||||
@@ -80,7 +81,6 @@ QVariantMap DeployConfiguration::toMap() const
|
||||
QVariantMap map(ProjectConfiguration::toMap());
|
||||
map.insert(QLatin1String(BUILD_STEP_LIST_COUNT), 1);
|
||||
map.insert(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1String("0"), m_stepList->toMap());
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,8 @@ bool DeployConfiguration::fromMap(const QVariantMap &map)
|
||||
return false;
|
||||
|
||||
int maxI = map.value(QLatin1String(BUILD_STEP_LIST_COUNT), 0).toInt();
|
||||
Q_ASSERT(maxI == 1);
|
||||
if (maxI != 1)
|
||||
return false;
|
||||
QVariantMap data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1String("0")).toMap();
|
||||
if (!data.isEmpty()) {
|
||||
m_stepList = new BuildStepList(this, data);
|
||||
@@ -105,11 +106,13 @@ bool DeployConfiguration::fromMap(const QVariantMap &map)
|
||||
m_stepList = 0;
|
||||
return false;
|
||||
}
|
||||
m_stepList->setDefaultDisplayName(tr("Deploy"));
|
||||
} else {
|
||||
qWarning() << "No data for deploy step list found!";
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: We assume that we have hold the deploy list
|
||||
// TODO: We assume that we hold the deploy list
|
||||
Q_ASSERT(m_stepList && m_stepList->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY));
|
||||
|
||||
return true;
|
||||
|
||||
@@ -64,7 +64,6 @@ ProcessStep::ProcessStep(BuildStepList *bsl, const QString &id) :
|
||||
|
||||
ProcessStep::ProcessStep(BuildStepList *bsl, ProcessStep *bs) :
|
||||
AbstractProcessStep(bsl, bs),
|
||||
m_name(bs->m_name),
|
||||
m_command(bs->m_command),
|
||||
m_arguments(bs->m_arguments),
|
||||
m_workingDirectory(bs->m_workingDirectory),
|
||||
@@ -76,7 +75,8 @@ ProcessStep::ProcessStep(BuildStepList *bsl, ProcessStep *bs) :
|
||||
|
||||
void ProcessStep::ctor()
|
||||
{
|
||||
setDisplayName(tr("Custom Process Step", "item in combobox"));
|
||||
//: Default ProcessStep display name
|
||||
setDefaultDisplayName(tr("Custom Process Step"));
|
||||
}
|
||||
|
||||
ProcessStep::~ProcessStep()
|
||||
@@ -255,8 +255,6 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step)
|
||||
connect(m_ui.workingDirectory, SIGNAL(changed(QString)),
|
||||
this, SLOT(workingDirectoryLineEditTextEdited()));
|
||||
|
||||
connect(m_ui.nameLineEdit, SIGNAL(textEdited(const QString&)),
|
||||
this, SLOT(nameLineEditTextEdited()));
|
||||
connect(m_ui.commandArgumentsLineEdit, SIGNAL(textEdited(const QString&)),
|
||||
this, SLOT(commandArgumentsLineEditTextEdited()));
|
||||
connect(m_ui.enabledCheckBox, SIGNAL(clicked(bool)),
|
||||
@@ -293,7 +291,6 @@ void ProcessStepConfigWidget::init()
|
||||
m_ui.commandArgumentsLineEdit->setText(m_step->arguments().join(QString(QLatin1Char(' '))));
|
||||
m_ui.enabledCheckBox->setChecked(m_step->enabled());
|
||||
|
||||
m_ui.nameLineEdit->setText(m_step->displayName());
|
||||
updateDetails();
|
||||
}
|
||||
|
||||
@@ -302,12 +299,6 @@ QString ProcessStepConfigWidget::summaryText() const
|
||||
return m_summaryText;
|
||||
}
|
||||
|
||||
void ProcessStepConfigWidget::nameLineEditTextEdited()
|
||||
{
|
||||
m_step->setDisplayName(m_ui.nameLineEdit->text());
|
||||
emit updateDetails();
|
||||
}
|
||||
|
||||
void ProcessStepConfigWidget::commandLineEditTextEdited()
|
||||
{
|
||||
m_step->setCommand(m_ui.command->path());
|
||||
|
||||
@@ -93,7 +93,6 @@ protected:
|
||||
private:
|
||||
void ctor();
|
||||
|
||||
QString m_name;
|
||||
QString m_command;
|
||||
QStringList m_arguments;
|
||||
QString m_workingDirectory;
|
||||
@@ -110,7 +109,6 @@ public:
|
||||
virtual void init();
|
||||
virtual QString summaryText() const;
|
||||
private slots:
|
||||
void nameLineEditTextEdited();
|
||||
void commandLineEditTextEdited();
|
||||
void workingDirectoryLineEditTextEdited();
|
||||
void commandArgumentsLineEditTextEdited();
|
||||
|
||||
@@ -6,11 +6,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>299</width>
|
||||
<height>154</height>
|
||||
<width>290</width>
|
||||
<height>95</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
@@ -26,43 +29,33 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="nameLabel">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="nameLineEdit"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="commandLabel">
|
||||
<property name="text">
|
||||
<string>Command:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="1" column="1">
|
||||
<widget class="Utils::PathChooser" name="command" native="true"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="workingDirecoryLabel">
|
||||
<property name="text">
|
||||
<string>Working directory:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="Utils::PathChooser" name="workingDirectory" native="true"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="commandArgumentsLabel">
|
||||
<property name="text">
|
||||
<string>Command arguments:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="commandArgumentsLineEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -133,7 +133,7 @@ void Project::addTarget(Target *t)
|
||||
foreach (const Target *target, m_targets)
|
||||
displayNames << target->displayName();
|
||||
targetDisplayName = makeUnique(targetDisplayName, displayNames);
|
||||
t->setDisplayName(targetDisplayName);
|
||||
t->setDefaultDisplayName(targetDisplayName);
|
||||
|
||||
// add it
|
||||
m_targets.push_back(t);
|
||||
|
||||
@@ -34,6 +34,7 @@ using namespace ProjectExplorer;
|
||||
namespace {
|
||||
const char * const CONFIGURATION_ID_KEY("ProjectExplorer.ProjectConfiguration.Id");
|
||||
const char * const DISPLAY_NAME_KEY("ProjectExplorer.ProjectConfiguration.DisplayName");
|
||||
const char * const DEFAULT_DISPLAY_NAME_KEY("ProjectExplorer.ProjectConfiguration.DefaultDisplayName");
|
||||
}
|
||||
|
||||
ProjectConfiguration::ProjectConfiguration(QObject *parent, const QString &id) :
|
||||
@@ -44,10 +45,11 @@ ProjectConfiguration::ProjectConfiguration(QObject *parent, const QString &id) :
|
||||
}
|
||||
|
||||
ProjectConfiguration::ProjectConfiguration(QObject *parent, const ProjectConfiguration *source) :
|
||||
QObject(parent)
|
||||
QObject(parent),
|
||||
m_id(source->m_id),
|
||||
m_defaultDisplayName(source->m_defaultDisplayName)
|
||||
{
|
||||
Q_ASSERT(source);
|
||||
m_id = source->m_id;
|
||||
m_displayName = tr("Clone of %1").arg(source->displayName());
|
||||
}
|
||||
|
||||
@@ -61,22 +63,35 @@ QString ProjectConfiguration::id() const
|
||||
|
||||
QString ProjectConfiguration::displayName() const
|
||||
{
|
||||
return m_displayName;
|
||||
if (!m_displayName.isEmpty())
|
||||
return m_displayName;
|
||||
return m_defaultDisplayName;
|
||||
}
|
||||
|
||||
void ProjectConfiguration::setDisplayName(const QString &name)
|
||||
{
|
||||
if (name == m_displayName)
|
||||
if (displayName() == name)
|
||||
return;
|
||||
m_displayName = name;
|
||||
emit displayNameChanged();
|
||||
}
|
||||
|
||||
void ProjectConfiguration::setDefaultDisplayName(const QString &name)
|
||||
{
|
||||
if (m_defaultDisplayName == name)
|
||||
return;
|
||||
const QString originalName = displayName();
|
||||
m_defaultDisplayName = name;
|
||||
if (originalName != displayName())
|
||||
emit displayNameChanged();
|
||||
}
|
||||
|
||||
QVariantMap ProjectConfiguration::toMap() const
|
||||
{
|
||||
QVariantMap map;
|
||||
map.insert(QLatin1String(CONFIGURATION_ID_KEY), m_id);
|
||||
map.insert(QLatin1String(DISPLAY_NAME_KEY), m_displayName);
|
||||
map.insert(QLatin1String(DEFAULT_DISPLAY_NAME_KEY), m_defaultDisplayName);
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -84,6 +99,7 @@ bool ProjectConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
m_id = map.value(QLatin1String(CONFIGURATION_ID_KEY), QString()).toString();
|
||||
m_displayName = map.value(QLatin1String(DISPLAY_NAME_KEY), QString()).toString();
|
||||
m_defaultDisplayName = map.value(QLatin1String(DEFAULT_DISPLAY_NAME_KEY), m_displayName).toString();
|
||||
return !m_id.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ public:
|
||||
QString id() const;
|
||||
QString displayName() const;
|
||||
void setDisplayName(const QString &name);
|
||||
void setDefaultDisplayName(const QString &name);
|
||||
|
||||
// Note: Make sure subclasses call the superclasses toMap() method!
|
||||
virtual QVariantMap toMap() const;
|
||||
@@ -70,6 +71,7 @@ private:
|
||||
|
||||
QString m_id;
|
||||
QString m_displayName;
|
||||
QString m_defaultDisplayName;
|
||||
};
|
||||
|
||||
// helper functions:
|
||||
|
||||
@@ -281,16 +281,18 @@ void RunSettingsWidget::renameRunConfiguration()
|
||||
arg(m_target->activeRunConfiguration()->displayName()),
|
||||
QLineEdit::Normal,
|
||||
m_target->activeRunConfiguration()->displayName(), &ok);
|
||||
if (!ok || !this || name.isEmpty())
|
||||
if (!ok || !this)
|
||||
return;
|
||||
|
||||
QStringList rcNames;
|
||||
foreach (RunConfiguration *rc, m_target->runConfigurations()) {
|
||||
if (rc == m_target->activeRunConfiguration())
|
||||
continue;
|
||||
rcNames.append(rc->displayName());
|
||||
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 = Project::makeUnique(name, rcNames);
|
||||
m_target->activeRunConfiguration()->setDisplayName(name);
|
||||
}
|
||||
|
||||
@@ -371,16 +373,18 @@ void RunSettingsWidget::renameDeployConfiguration()
|
||||
arg(m_target->activeDeployConfiguration()->displayName()),
|
||||
QLineEdit::Normal,
|
||||
m_target->activeDeployConfiguration()->displayName(), &ok);
|
||||
if (!ok || !this || name.isEmpty())
|
||||
if (!ok || !this)
|
||||
return;
|
||||
|
||||
QStringList dcNames;
|
||||
foreach (DeployConfiguration *dc, m_target->deployConfigurations()) {
|
||||
if (dc == m_target->activeDeployConfiguration())
|
||||
continue;
|
||||
dcNames.append(dc->displayName());
|
||||
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 = Project::makeUnique(name, dcNames);
|
||||
m_target->activeDeployConfiguration()->setDisplayName(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ MakeStep::MakeStep(ProjectExplorer::BuildStepList *bsl, const QString &id) :
|
||||
|
||||
void MakeStep::ctor()
|
||||
{
|
||||
setDisplayName(tr("Make", "Qt4 MakeStep display name."));
|
||||
setDefaultDisplayName(tr("Make", "Qt4 MakeStep display name."));
|
||||
}
|
||||
|
||||
MakeStep::~MakeStep()
|
||||
|
||||
@@ -80,7 +80,8 @@ QMakeStep::QMakeStep(BuildStepList *bsl, QMakeStep *bs) :
|
||||
|
||||
void QMakeStep::ctor()
|
||||
{
|
||||
setDisplayName(tr("qmake", "QMakeStep display name."));
|
||||
//: QMakeStep default display name
|
||||
setDefaultDisplayName(tr("qmake"));
|
||||
}
|
||||
|
||||
QMakeStep::~QMakeStep()
|
||||
|
||||
@@ -85,7 +85,8 @@ MaemoDeployStep::~MaemoDeployStep()
|
||||
|
||||
void MaemoDeployStep::ctor()
|
||||
{
|
||||
setDisplayName(tr("Deploying to Maemo device"));
|
||||
//: MaemoDeployStep default display name
|
||||
setDefaultDisplayName(tr("Deploy to Maemo device"));
|
||||
|
||||
m_connecting = false;
|
||||
m_needsInstall = false;
|
||||
|
||||
@@ -97,7 +97,7 @@ MaemoPackageCreationStep::~MaemoPackageCreationStep()
|
||||
|
||||
void MaemoPackageCreationStep::ctor()
|
||||
{
|
||||
setDisplayName(tr("Packaging for Maemo"));
|
||||
setDefaultDisplayName(tr("Packaging for Maemo"));
|
||||
|
||||
m_lastBuildConfig = qt4BuildConfiguration();
|
||||
connect(target(),
|
||||
|
||||
@@ -87,8 +87,8 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
|
||||
|
||||
void MaemoRunConfiguration::init()
|
||||
{
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
m_remoteMounts = new MaemoRemoteMountsModel(this);
|
||||
setDisplayName(QFileInfo(m_proFilePath).completeBaseName());
|
||||
|
||||
connect(target(),
|
||||
SIGNAL(activeDeployConfigurationChanged(ProjectExplorer::DeployConfiguration*)),
|
||||
@@ -168,9 +168,19 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
|
||||
SystemEnvironmentBase).toInt());
|
||||
m_remoteMounts->fromMap(map);
|
||||
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QString MaemoRunConfiguration::defaultDisplayName()
|
||||
{
|
||||
if (!m_proFilePath.isEmpty())
|
||||
return (QFileInfo(m_proFilePath).completeBaseName());
|
||||
//: Maemo run configuration default display name
|
||||
return tr("Run on maemo device");
|
||||
}
|
||||
|
||||
MaemoDeviceConfig MaemoRunConfiguration::deviceConfig() const
|
||||
{
|
||||
return deployStep()->deviceConfigModel()->current();
|
||||
|
||||
@@ -126,6 +126,7 @@ signals:
|
||||
protected:
|
||||
MaemoRunConfiguration(Qt4Target *parent, MaemoRunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
QString defaultDisplayName();
|
||||
|
||||
private slots:
|
||||
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||
|
||||
@@ -115,7 +115,8 @@ S60CreatePackageStep::S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl,
|
||||
|
||||
void S60CreatePackageStep::ctor_package()
|
||||
{
|
||||
setDisplayName(tr("Create SIS Package", "Create SIS package build step name"));
|
||||
//: default create SIS package build step display name
|
||||
setDefaultDisplayName(tr("Create SIS Package"));
|
||||
connect(this, SIGNAL(badPassphrase()),
|
||||
this, SLOT(definePassphrase()), Qt::QueuedConnection);
|
||||
|
||||
|
||||
@@ -109,14 +109,13 @@ S60DeployConfiguration::S60DeployConfiguration(Target *target, S60DeployConfigur
|
||||
|
||||
void S60DeployConfiguration::ctor()
|
||||
{
|
||||
S60DeviceRunConfiguration* runConf = s60DeviceRunConf();
|
||||
if (runConf && !runConf->projectFilePath().isEmpty())
|
||||
setDisplayName(tr("%1 on Symbian Device").arg(QFileInfo(runConf->projectFilePath()).completeBaseName()));
|
||||
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||
connect(qt4Target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
|
||||
connect(qt4Target(), SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)),
|
||||
this, SLOT(updateActiveRunConfiguration(ProjectExplorer::RunConfiguration*)));
|
||||
updateActiveBuildConfiguration(qt4Target()->activeBuildConfiguration());
|
||||
}
|
||||
|
||||
@@ -132,8 +131,7 @@ ProjectExplorer::DeployConfigurationWidget *S60DeployConfiguration::configuratio
|
||||
void S60DeployConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||
{
|
||||
S60DeviceRunConfiguration *deviceRunConf = s60DeviceRunConf();
|
||||
Q_ASSERT(deviceRunConf);
|
||||
if (deviceRunConf->projectFilePath() == pro->path())
|
||||
if (deviceRunConf && deviceRunConf->projectFilePath() == pro->path())
|
||||
emit targetInformationChanged();
|
||||
}
|
||||
|
||||
@@ -349,14 +347,15 @@ void S60DeployConfiguration::updateActiveBuildConfiguration(ProjectExplorer::Bui
|
||||
this, SIGNAL(targetInformationChanged()));
|
||||
}
|
||||
|
||||
void S60DeployConfiguration::updateActiveRunConfiguration(ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
{
|
||||
Q_UNUSED(runConfiguration);
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
}
|
||||
|
||||
S60DeviceRunConfiguration* S60DeployConfiguration::s60DeviceRunConf() const
|
||||
{
|
||||
const char * const S60_DEVICE_RC_ID("Qt4ProjectManager.S60DeviceRunConfiguration");
|
||||
|
||||
foreach( RunConfiguration *runConf, qt4Target()->runConfigurations() )
|
||||
if (runConf->id() == QLatin1String(S60_DEVICE_RC_ID))
|
||||
return qobject_cast<S60DeviceRunConfiguration *>(runConf);
|
||||
return 0;
|
||||
return qobject_cast<S60DeviceRunConfiguration *>(qt4Target()->activeRunConfiguration());
|
||||
}
|
||||
|
||||
QVariantMap S60DeployConfiguration::toMap() const
|
||||
@@ -369,13 +368,24 @@ QVariantMap S60DeployConfiguration::toMap() const
|
||||
return map;
|
||||
}
|
||||
|
||||
QString S60DeployConfiguration::defaultDisplayName() const
|
||||
{
|
||||
S60DeviceRunConfiguration* runConf = s60DeviceRunConf();
|
||||
if (runConf && !runConf->projectFilePath().isEmpty())
|
||||
return tr("Deploy %1 to Symbian device").arg(QFileInfo(runConf->projectFilePath()).completeBaseName());
|
||||
return tr("Deploy to Symbian device");
|
||||
}
|
||||
|
||||
bool S60DeployConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
if (!DeployConfiguration::fromMap(map))
|
||||
return false;
|
||||
m_serialPortName = map.value(QLatin1String(SERIAL_PORT_NAME_KEY)).toString().trimmed();
|
||||
m_installationDrive = map.value(QLatin1String(INSTALLATION_DRIVE_LETTER_KEY), QChar('C'))
|
||||
.toChar().toAscii();
|
||||
m_silentInstall = map.value(QLatin1String(SILENT_INSTALL_KEY), QVariant(true)).toBool();
|
||||
return DeployConfiguration::fromMap(map);
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
return true;
|
||||
}
|
||||
|
||||
Qt4Target *S60DeployConfiguration::qt4Target() const
|
||||
|
||||
@@ -87,11 +87,13 @@ signals:
|
||||
|
||||
private slots:
|
||||
void updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfiguration);
|
||||
void updateActiveRunConfiguration(ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||
|
||||
protected:
|
||||
S60DeployConfiguration(ProjectExplorer::Target *parent, S60DeployConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
QString defaultDisplayName() const;
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
|
||||
@@ -93,6 +93,7 @@ S60DeployStep::S60DeployStep(ProjectExplorer::BuildStepList *bc,
|
||||
m_handleDeviceRemoval(bs->m_handleDeviceRemoval),
|
||||
m_launcher(0), m_eventLoop(0)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
S60DeployStep::S60DeployStep(ProjectExplorer::BuildStepList *bc):
|
||||
@@ -100,6 +101,13 @@ S60DeployStep::S60DeployStep(ProjectExplorer::BuildStepList *bc):
|
||||
m_releaseDeviceAfterLauncherFinish(true),
|
||||
m_handleDeviceRemoval(true), m_launcher(0), m_eventLoop(0)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
void S60DeployStep::ctor()
|
||||
{
|
||||
//: Qt4 Deploystep display name
|
||||
setDefaultDisplayName(tr("Deploy"));
|
||||
}
|
||||
|
||||
S60DeployStep::~S60DeployStep()
|
||||
@@ -123,7 +131,6 @@ bool S60DeployStep::init()
|
||||
m_installationDrive = deployConfiguration->installationDrive();
|
||||
m_silentInstall = deployConfiguration->silentInstall();
|
||||
|
||||
setDisplayName(tr("Deploy", "Qt4 DeployStep display name."));
|
||||
QString message;
|
||||
if (m_launcher) {
|
||||
trk::Launcher::releaseToDeviceManager(m_launcher);
|
||||
|
||||
@@ -118,6 +118,7 @@ signals:
|
||||
private:
|
||||
S60DeployStep(ProjectExplorer::BuildStepList *parent,
|
||||
S60DeployStep *bs);
|
||||
void ctor();
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
@@ -125,9 +125,11 @@ S60DeviceRunConfiguration::S60DeviceRunConfiguration(Target *target, S60DeviceRu
|
||||
void S60DeviceRunConfiguration::ctor()
|
||||
{
|
||||
if (!m_proFilePath.isEmpty())
|
||||
setDisplayName(tr("%1 on Symbian Device").arg(QFileInfo(m_proFilePath).completeBaseName()));
|
||||
//: S60 device runconfiguration default display name, %1 is base pro-File name
|
||||
setDefaultDisplayName(tr("%1 on Symbian Device").arg(QFileInfo(m_proFilePath).completeBaseName()));
|
||||
else
|
||||
setDisplayName(tr("QtS60DeviceRunConfiguration"));
|
||||
//: S60 device runconfiguration default display name (no profile set)
|
||||
setDefaultDisplayName(tr("Run on Symbian device"));
|
||||
}
|
||||
|
||||
void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||
@@ -204,6 +206,12 @@ bool S60DeviceRunConfiguration::fromMap(const QVariantMap &map)
|
||||
m_proFilePath = projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString());
|
||||
m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toStringList();
|
||||
|
||||
if (m_proFilePath.isEmpty())
|
||||
return false;
|
||||
if (!QFileInfo(m_proFilePath).exists())
|
||||
return false;
|
||||
setDefaultDisplayName(tr("%1 on Symbian Device").arg(QFileInfo(m_proFilePath).completeBaseName()));
|
||||
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ signals:
|
||||
|
||||
protected:
|
||||
S60DeviceRunConfiguration(ProjectExplorer::Target *parent, S60DeviceRunConfiguration *source);
|
||||
QString defaultDisplayName() const;
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private:
|
||||
|
||||
@@ -95,10 +95,11 @@ S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Target *parent, S60Emul
|
||||
void S60EmulatorRunConfiguration::ctor()
|
||||
{
|
||||
if (!m_proFilePath.isEmpty())
|
||||
setDisplayName(tr("%1 in Symbian Emulator").arg(QFileInfo(m_proFilePath).completeBaseName()));
|
||||
//: S60 emulator run configuration default display name, %1 is base pro-File name
|
||||
setDefaultDisplayName(tr("%1 in Symbian Emulator").arg(QFileInfo(m_proFilePath).completeBaseName()));
|
||||
else
|
||||
setDisplayName(tr("Qt Symbian Emulator RunConfiguration"));
|
||||
|
||||
//: S60 emulator run configuration default display name (no pro-file name)
|
||||
setDefaultDisplayName(tr("Run on Symbian Emulator"));
|
||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||
}
|
||||
@@ -150,6 +151,11 @@ bool S60EmulatorRunConfiguration::fromMap(const QVariantMap &map)
|
||||
const QDir projectDir = QDir(target()->project()->projectDirectory());
|
||||
m_proFilePath = projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString());
|
||||
|
||||
if (m_proFilePath.isEmpty())
|
||||
return false;
|
||||
//: S60 emulator run configuration default display name, %1 is base pro-File name
|
||||
setDefaultDisplayName(tr("%1 in Symbian Emulator").arg(QFileInfo(m_proFilePath).completeBaseName()));
|
||||
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,11 +60,11 @@ ProjectExplorer::DeployConfiguration *Qt4DeployConfigurationFactory::create(Proj
|
||||
return 0;
|
||||
|
||||
if (parent->id() == Constants::S60_DEVICE_TARGET_ID) {
|
||||
dc->setDisplayName(tr("Deploy to Symbian device"));
|
||||
dc->setDefaultDisplayName(tr("Deploy to Symbian device"));
|
||||
dc->stepList()->insertStep(0, new S60CreatePackageStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(1, new S60DeployStep(dc->stepList()));
|
||||
} else if (parent->id() == Constants::MAEMO_DEVICE_TARGET_ID) {
|
||||
dc->setDisplayName(tr("Deploy to Maemo device"));
|
||||
dc->setDefaultDisplayName(tr("Deploy to Maemo device"));
|
||||
dc->stepList()->insertStep(0, new MaemoPackageCreationStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(1, new MaemoDeployStep(dc->stepList()));
|
||||
}
|
||||
|
||||
@@ -163,9 +163,7 @@ void Qt4RunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileN
|
||||
|
||||
void Qt4RunConfiguration::ctor()
|
||||
{
|
||||
QString name = defaultDisplayName();
|
||||
if (name != displayName())
|
||||
setDisplayName(name);
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
|
||||
connect(qt4Target(), SIGNAL(environmentChanged()),
|
||||
this, SIGNAL(baseEnvironmentChanged()));
|
||||
@@ -456,7 +454,6 @@ bool Qt4RunConfiguration::fromMap(const QVariantMap &map)
|
||||
m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
|
||||
m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(Qt4RunConfiguration::BuildEnvironmentBase)).toInt());
|
||||
|
||||
// This will restore the display name for us:
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ Qt4Target::Qt4Target(Qt4Project *parent, const QString &id) :
|
||||
connect(this, SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)),
|
||||
this, SLOT(updateToolTipAndIcon()));
|
||||
|
||||
setDisplayName(displayNameForId(id));
|
||||
setDefaultDisplayName(displayNameForId(id));
|
||||
setIcon(iconForId(id));
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ Qt4BuildConfiguration *Qt4Target::addQt4BuildConfiguration(QString displayName,
|
||||
|
||||
// Add the buildconfiguration
|
||||
Qt4BuildConfiguration *bc = new Qt4BuildConfiguration(this);
|
||||
bc->setDisplayName(displayName);
|
||||
bc->setDefaultDisplayName(displayName);
|
||||
|
||||
BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
BuildStepList *cleanSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
|
||||
@@ -404,13 +404,9 @@ QString Qt4Target::defaultShadowBuildDirectory(const QString &projectLocation, c
|
||||
|
||||
bool Qt4Target::fromMap(const QVariantMap &map)
|
||||
{
|
||||
if (!Target::fromMap(map))
|
||||
return false;
|
||||
|
||||
setDisplayName(displayNameForId(id()));
|
||||
bool success = Target::fromMap(map);
|
||||
setIcon(iconForId(id()));
|
||||
|
||||
return true;
|
||||
return success;
|
||||
}
|
||||
|
||||
void Qt4Target::updateQtVersion()
|
||||
|
||||
Reference in New Issue
Block a user