Qbs: Remove some dead code

Change-Id: I94fee7575bb39721391da2c0f5df669172b71028
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Tobias Hunger
2013-06-12 17:30:22 +02:00
parent 8c6b1f1b0c
commit c265803a7a
5 changed files with 2 additions and 219 deletions

View File

@@ -54,5 +54,4 @@ SOURCES = \
FORMS = \
qbsbuildstepconfigwidget.ui \
qbscleanstepconfigwidget.ui \
qbsinstallstepconfigwidget.ui \
qbsstepconfigwidget.ui
qbsinstallstepconfigwidget.ui

View File

@@ -84,8 +84,7 @@ QtcPlugin {
"qbsrunconfiguration.cpp",
"qbsrunconfiguration.h",
"qbsstep.cpp",
"qbsstep.h",
"qbsstepconfigwidget.ui"
"qbsstep.h"
]
}

View File

@@ -240,105 +240,5 @@ void QbsStep::setMaxJobs(int jobcount)
emit qbsBuildOptionsChanged();
}
// --------------------------------------------------------------------
// QbsStepConfigWidget:
// --------------------------------------------------------------------
QbsStepConfigWidget::QbsStepConfigWidget(QbsStep *step) :
m_step(step)
{
connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState()));
connect(m_step, SIGNAL(qbsBuildOptionsChanged()), this, SLOT(updateState()));
setContentsMargins(0, 0, 0, 0);
m_ui = new Ui::QbsStepConfigWidget;
m_ui->setupUi(this);
connect(m_ui->dryRunCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeDryRun(bool)));
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool)));
connect(m_ui->jobSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeJobCount(int)));
QTimer::singleShot(0, this, SLOT(updateState()));
}
QString QbsStepConfigWidget::summaryText() const
{
return m_summary;
}
QString QbsStepConfigWidget::displayName() const
{
return m_step->displayName();
}
void QbsStepConfigWidget::updateState()
{
m_ui->dryRunCheckBox->setChecked(m_step->dryRun());
m_ui->keepGoingCheckBox->setChecked(m_step->keepGoing());
m_ui->jobSpinBox->setValue(m_step->maxJobs());
QString command = QLatin1String("qbs");
const QString qbsCmd = qbsCommand();
if (!qbsCmd.isEmpty()) {
command += QLatin1String(" ");
command += qbsCmd;
}
const QString buildDir = m_step->target()->activeBuildConfiguration()->buildDirectory();
const QString sourceDir = m_step->project()->projectDirectory();
if (buildDir != sourceDir)
command += QString::fromLatin1(" -f \"%1\"").arg(QDir(buildDir).relativeFilePath(sourceDir));
if (m_step->dryRun())
command += QLatin1String(" --dry-run");
if (m_step->keepGoing())
command += QLatin1String(" --keep-going");
if (m_step->maxJobs() != QbsManager::preferences()->jobs())
command += QString::fromLatin1(" --jobs %1").arg(m_step->maxJobs());
const QString args = additionalQbsArguments();
if (!args.isEmpty()) {
command += QLatin1String(" ");
command += args;
}
QString summary = tr("<b>Qbs:</b> %1").arg(command);
if (m_summary != summary) {
m_summary = summary;
emit updateSummary();
}
}
void QbsStepConfigWidget::changeDryRun(bool dr)
{
m_step->setDryRun(dr);
}
void QbsStepConfigWidget::changeKeepGoing(bool kg)
{
m_step->setKeepGoing(kg);
}
void QbsStepConfigWidget::changeJobCount(int count)
{
m_step->setMaxJobs(count);
}
void QbsStepConfigWidget::addWidget(QWidget *widget)
{
if (widget)
static_cast<QVBoxLayout *>(layout())->insertWidget(0, widget);
updateState();
}
void QbsStepConfigWidget::setJobCountUiVisible(bool show)
{
m_ui->jobSpinBox->setVisible(show);
m_ui->jobLabel->setVisible(show);
}
} // namespace Internal
} // namespace QbsProjectManager

View File

@@ -102,41 +102,6 @@ private:
friend class QbsStepConfigWidget;
};
namespace Ui { class QbsStepConfigWidget; }
class QbsStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
{
Q_OBJECT
public:
QbsStepConfigWidget(QbsStep *step);
QString summaryText() const;
QString displayName() const;
private slots:
void changeDryRun(bool dr);
void changeKeepGoing(bool kg);
void changeJobCount(int count);
protected slots:
void updateState();
protected:
void addWidget(QWidget *widget);
void setJobCountUiVisible(bool show);
virtual QString qbsCommand() const = 0;
virtual QString additionalQbsArguments() const = 0;
QbsStep *buildStep() const { return m_step; }
private:
Ui::QbsStepConfigWidget *m_ui;
QbsStep *m_step;
QString m_summary;
};
} // namespace Internal
} // namespace QbsProjectManager

View File

@@ -1,80 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QbsProjectManager::Internal::QbsStepConfigWidget</class>
<widget class="QWidget" name="QbsProjectManager::Internal::QbsStepConfigWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>344</width>
<height>45</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>10</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="dryRunCheckBox">
<property name="text">
<string>Dry run</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="keepGoingCheckBox">
<property name="text">
<string>Keep Going</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QSpinBox" name="jobSpinBox">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="jobLabel">
<property name="text">
<string>jobs</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>