Commit 2cc7bea0 authored by dt_'s avatar dt_ Committed by Daniel Teske

Remove BuildStepConfigWidget::init()

It serves no purpose anymore.

Change-Id: Ifc15b29c7736bacde3b310e6c4dc980314145d14
Reviewed-on: http://codereview.qt.nokia.com/217Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 8ea4b970
......@@ -223,8 +223,7 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
m_additionalArguments = new QLineEdit(this);
fl->addRow(tr("Additional arguments:"), m_additionalArguments);
connect(m_additionalArguments, SIGNAL(textEdited(const QString &)), this, SLOT(additionalArgumentsEdited()));
m_additionalArguments->setText(m_makeStep->additionalArguments());
m_buildTargetsList = new QListWidget;
m_buildTargetsList->setMinimumHeight(200);
......@@ -236,12 +235,18 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
foreach(const QString& buildTarget, pro->buildTargetTitles()) {
QListWidgetItem *item = new QListWidgetItem(buildTarget, m_buildTargetsList);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(Qt::Unchecked);
item->setCheckState(m_makeStep->buildsBuildTarget(item->text()) ? Qt::Checked : Qt::Unchecked);
}
updateDetails();
connect(m_additionalArguments, SIGNAL(textEdited(const QString &)), this, SLOT(additionalArgumentsEdited()));
connect(m_buildTargetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
this, SLOT(updateDetails()));
connect(pro, SIGNAL(buildTargetsChanged()),
this, SLOT(buildTargetsChanged()));
}
void MakeStepConfigWidget::additionalArgumentsEdited()
......@@ -261,26 +266,6 @@ QString MakeStepConfigWidget::displayName() const
return tr("Make", "CMakeProjectManager::MakeStepConfigWidget display name.");
}
void MakeStepConfigWidget::init()
{
// disconnect to make the changes to the items
disconnect(m_buildTargetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
int count = m_buildTargetsList->count();
for(int i = 0; i < count; ++i) {
QListWidgetItem *item = m_buildTargetsList->item(i);
item->setCheckState(m_makeStep->buildsBuildTarget(item->text()) ? Qt::Checked : Qt::Unchecked);
}
// and connect again
connect(m_buildTargetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
m_additionalArguments->setText(m_makeStep->additionalArguments());
updateDetails();
CMakeProject *pro = m_makeStep->cmakeBuildConfiguration()->cmakeTarget()->cmakeProject();
connect(pro, SIGNAL(buildTargetsChanged()),
this, SLOT(buildTargetsChanged()));
}
void MakeStepConfigWidget::buildTargetsChanged()
{
disconnect(m_buildTargetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
......
......@@ -100,7 +100,6 @@ class MakeStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
public:
MakeStepConfigWidget(MakeStep *makeStep);
virtual QString displayName() const;
virtual void init();
virtual QString summaryText() const;
private slots:
void itemChanged(QListWidgetItem*);
......
......@@ -207,9 +207,14 @@ GenericMakeStepConfigWidget::GenericMakeStepConfigWidget(GenericMakeStep *makeSt
foreach (const QString &target, pro->buildTargets()) {
QListWidgetItem *item = new QListWidgetItem(target, m_ui->targetsList);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(Qt::Unchecked);
item->setCheckState(m_makeStep->buildsTarget(item->text()) ? Qt::Checked : Qt::Unchecked);
}
m_ui->makeLineEdit->setText(m_makeStep->m_makeCommand);
m_ui->makeArgumentsLineEdit->setText(m_makeStep->m_makeArguments);
updateMakeOverrrideLabel();
updateDetails();
connect(m_ui->targetsList, SIGNAL(itemChanged(QListWidgetItem*)),
this, SLOT(itemChanged(QListWidgetItem*)));
connect(m_ui->makeLineEdit, SIGNAL(textEdited(QString)),
......@@ -234,27 +239,6 @@ void GenericMakeStepConfigWidget::updateMakeOverrrideLabel()
m_ui->makeLabel->setText(tr("Override %1:").arg(m_makeStep->makeCommand()));
}
void GenericMakeStepConfigWidget::init()
{
updateMakeOverrrideLabel();
m_ui->makeLineEdit->setText(m_makeStep->m_makeCommand);
m_ui->makeArgumentsLineEdit->setText(m_makeStep->m_makeArguments);
// Disconnect to make the changes to the items
disconnect(m_ui->targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
int count = m_ui->targetsList->count();
for (int i = 0; i < count; ++i) {
QListWidgetItem *item = m_ui->targetsList->item(i);
item->setCheckState(m_makeStep->buildsTarget(item->text()) ? Qt::Checked : Qt::Unchecked);
}
updateDetails();
// and connect again
connect(m_ui->targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
}
void GenericMakeStepConfigWidget::updateDetails()
{
GenericBuildConfiguration *bc = m_makeStep->genericBuildConfiguration();
......
......@@ -94,7 +94,6 @@ class GenericMakeStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
public:
GenericMakeStepConfigWidget(GenericMakeStep *makeStep);
virtual QString displayName() const;
virtual void init();
virtual QString summaryText() const;
private slots:
void itemChanged(QListWidgetItem*);
......
......@@ -132,7 +132,6 @@ public:
BuildStepConfigWidget()
: QWidget()
{}
virtual void init() = 0;
virtual QString summaryText() const = 0;
virtual QString displayName() const = 0;
signals:
......
......@@ -62,7 +62,6 @@ BuildStepsWidgetData::BuildStepsWidgetData(BuildStep *s) :
{
widget = s->createConfigWidget();
Q_ASSERT(widget);
widget->init();
detailsWidget = new Utils::DetailsWidget;
detailsWidget->setWidget(widget);
......
......@@ -259,6 +259,18 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step)
m_ui.setupUi(this);
m_ui.command->setExpectedKind(Utils::PathChooser::Command);
m_ui.workingDirectory->setExpectedKind(Utils::PathChooser::Directory);
m_ui.command->setEnvironment(m_step->buildConfiguration()->environment());
m_ui.command->setPath(m_step->command());
m_ui.workingDirectory->setEnvironment(m_step->buildConfiguration()->environment());
m_ui.workingDirectory->setPath(m_step->workingDirectory());
m_ui.commandArgumentsLineEdit->setText(m_step->arguments());
m_ui.enabledCheckBox->setChecked(m_step->enabled());
updateDetails();
connect(m_ui.command, SIGNAL(changed(QString)),
this, SLOT(commandLineEditTextEdited()));
connect(m_ui.workingDirectory, SIGNAL(changed(QString)),
......@@ -294,20 +306,6 @@ QString ProcessStepConfigWidget::displayName() const
return m_step->displayName();
}
void ProcessStepConfigWidget::init()
{
m_ui.command->setEnvironment(m_step->buildConfiguration()->environment());
m_ui.command->setPath(m_step->command());
m_ui.workingDirectory->setEnvironment(m_step->buildConfiguration()->environment());
m_ui.workingDirectory->setPath(m_step->workingDirectory());
m_ui.commandArgumentsLineEdit->setText(m_step->arguments());
m_ui.enabledCheckBox->setChecked(m_step->enabled());
updateDetails();
}
QString ProcessStepConfigWidget::summaryText() const
{
return m_summaryText;
......
......@@ -109,7 +109,6 @@ class ProcessStepConfigWidget : public BuildStepConfigWidget
public:
ProcessStepConfigWidget(ProcessStep *step);
virtual QString displayName() const;
virtual void init();
virtual QString summaryText() const;
private slots:
void commandLineEditTextEdited();
......
......@@ -288,6 +288,14 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
m_ui->makePathChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_ui->makePathChooser->setBaseDirectory(Utils::PathChooser::homePath());
const QString &makeCmd = m_makeStep->m_makeCmd;
m_ui->makePathChooser->setPath(makeCmd);
m_ui->makeArgumentsLineEdit->setText(m_makeStep->userArguments());
updateMakeOverrideLabel();
updateDetails();
connect(m_ui->makePathChooser, SIGNAL(changed(QString)),
this, SLOT(makeEdited()));
connect(m_ui->makeArgumentsLineEdit, SIGNAL(textEdited(QString)),
......@@ -382,17 +390,6 @@ void MakeStepConfigWidget::userArgumentsChanged()
updateDetails();
}
void MakeStepConfigWidget::init()
{
updateMakeOverrideLabel();
const QString &makeCmd = m_makeStep->m_makeCmd;
m_ui->makePathChooser->setPath(makeCmd);
m_ui->makeArgumentsLineEdit->setText(m_makeStep->userArguments());
updateDetails();
}
void MakeStepConfigWidget::makeEdited()
{
m_makeStep->m_makeCmd = m_ui->makePathChooser->rawPath();
......
......@@ -128,7 +128,6 @@ public:
virtual ~MakeStepConfigWidget();
QString displayName() const;
void init();
QString summaryText() const;
private slots:
// User changes to our widgets
......
......@@ -507,11 +507,6 @@ QMakeStepConfigWidget::~QMakeStepConfigWidget()
delete m_ui;
}
void QMakeStepConfigWidget::init()
{
}
QString QMakeStepConfigWidget::summaryText() const
{
return m_summaryText;
......
......@@ -142,7 +142,6 @@ class QMakeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
public:
QMakeStepConfigWidget(QMakeStep *step);
~QMakeStepConfigWidget();
void init();
QString summaryText() const;
QString displayName() const;
private slots:
......
......@@ -955,7 +955,3 @@ QString S60CreatePackageStepConfigWidget::displayName() const
{
return m_signStep->displayName();
}
void S60CreatePackageStepConfigWidget::init()
{
}
......@@ -191,7 +191,6 @@ class S60CreatePackageStepConfigWidget : public ProjectExplorer::BuildStepConfig
public:
S60CreatePackageStepConfigWidget(S60CreatePackageStep *signStep);
QString displayName() const;
void init();
QString summaryText() const;
private slots:
......
......@@ -858,10 +858,6 @@ S60DeployStepWidget::S60DeployStepWidget() : ProjectExplorer::BuildStepConfigWid
{
}
void S60DeployStepWidget::init()
{
}
QString S60DeployStepWidget::summaryText() const
{
return QString("<b>%1</b>").arg(displayName());
......
......@@ -234,7 +234,6 @@ class S60DeployStepWidget : public ProjectExplorer::BuildStepConfigWidget
public:
S60DeployStepWidget();
void init();
QString summaryText() const;
QString displayName() const;
};
......
......@@ -63,15 +63,7 @@ MaemoDeployStepBaseWidget::MaemoDeployStepBaseWidget(AbstractLinuxDeviceDeploySt
connect(list, SIGNAL(stepRemoved(int)), SIGNAL(updateSummary()));
connect(list, SIGNAL(aboutToRemoveStep(int)),
SLOT(handleStepToBeRemoved(int)));
}
MaemoDeployStepBaseWidget::~MaemoDeployStepBaseWidget()
{
delete ui;
}
void MaemoDeployStepBaseWidget::init()
{
ui->deviceConfigComboBox->setModel(m_step->maemoDeployConfig()->deviceConfigModel().data());
connect(&m_step->helper(), SIGNAL(deviceConfigChanged()),
SLOT(handleDeviceUpdate()));
......@@ -82,6 +74,11 @@ void MaemoDeployStepBaseWidget::init()
SLOT(showDeviceConfigurations()));
}
MaemoDeployStepBaseWidget::~MaemoDeployStepBaseWidget()
{
delete ui;
}
void MaemoDeployStepBaseWidget::handleDeviceUpdate()
{
const MaemoDeviceConfig::ConstPtr &devConf = m_step->helper().deviceConfig();
......
......@@ -54,7 +54,6 @@ public:
MaemoDeployStepBaseWidget(AbstractLinuxDeviceDeployStep *step);
~MaemoDeployStepBaseWidget();
void init();
QString summaryText() const;
signals:
......@@ -77,7 +76,6 @@ public:
MaemoDeployStepWidget(AbstractMaemoDeployStep *step);
private:
virtual void init() { return m_baseWidget.init(); }
virtual QString summaryText() const { return m_baseWidget.summaryText(); }
virtual QString displayName() const { return QString(); }
......
......@@ -57,9 +57,7 @@ class AbstractMaemoInstallPackageToSysrootWidget : public BuildStepConfigWidget
Q_OBJECT
public:
AbstractMaemoInstallPackageToSysrootWidget(AbstractMaemoInstallPackageToSysrootStep *step)
: m_step(step) {}
virtual void init()
: m_step(step)
{
BuildStepList * const list
= qobject_cast<BuildStepList *>(m_step->parent());
......@@ -117,9 +115,7 @@ class MaemoCopyFilesToSysrootWidget : public BuildStepConfigWidget
Q_OBJECT
public:
MaemoCopyFilesToSysrootWidget(const BuildStep *buildStep)
: m_buildStep(buildStep) {}
virtual void init()
: m_buildStep(buildStep)
{
if (m_buildStep) {
connect(m_buildStep.data(), SIGNAL(displayNameChanged()),
......
......@@ -578,9 +578,7 @@ class CreateTarStepWidget : public BuildStepConfigWidget
{
Q_OBJECT
public:
CreateTarStepWidget(MaemoTarPackageCreationStep *step) : m_step(step) {}
virtual void init()
CreateTarStepWidget(MaemoTarPackageCreationStep *step) : m_step(step)
{
connect(m_step, SIGNAL(packageFilePathChanged()),
SIGNAL(updateSummary()));
......
......@@ -68,10 +68,6 @@ MaemoPackageCreationWidget::~MaemoPackageCreationWidget()
delete m_ui;
}
void MaemoPackageCreationWidget::init()
{
}
void MaemoPackageCreationWidget::initGui()
{
m_ui->shortDescriptionLineEdit->setMaxLength(60);
......
......@@ -49,7 +49,6 @@ public:
MaemoPackageCreationWidget(AbstractMaemoPackageCreationStep *step);
~MaemoPackageCreationWidget();
virtual void init();
virtual QString summaryText() const;
virtual QString displayName() const;
......
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